/* Generated by Cython 3.2.4 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#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 < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_4"
#define CYTHON_HEX_VERSION 0x030204F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !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 PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 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
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #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
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #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(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #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_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #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 Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CppInitCode */
#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 ==(const U& other) const { return *ptr == other; }
    template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
    template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
    template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
  private:
    T *ptr;
};

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#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 Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#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_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #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_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#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
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #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)         ((int)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, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#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
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#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 CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
    #define __PYX_EXTERN_C extern "C++"
#endif

#define __PYX_HAVE__pyarrow___dataset
#define __PYX_HAVE_API__pyarrow___dataset
/* Early includes */
#include <stdint.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <functional>
#include <memory>
#include <optional>
#include <string.h>
#include <string_view>
#include <string>
#include <utility>

    #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)
    // move should be defined for these versions of MSVC, but __cplusplus isn't set usefully
    #include <type_traits>

    namespace cython_std {
    template <typename T> typename std::remove_reference<T>::type&& move(T& t) noexcept { return std::move(t); }
    template <typename T> typename std::remove_reference<T>::type&& move(T&& t) noexcept { return std::move(t); }
    }

    #endif
    
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stdio.h>

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE PyObject *
    __Pyx_CAPI_PyList_GetItemRef(PyObject *list, Py_ssize_t index)
    {
        PyObject *item = PyList_GetItem(list, index);
        Py_XINCREF(item);
        return item;
    }
    #else
    #define __Pyx_CAPI_PyList_GetItemRef PyList_GetItemRef
    #endif

    #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Extend(PyObject *list, PyObject *iterable)
    {
        return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable);
    }

    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Clear(PyObject *list)
    {
        return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
    }
    #else
    #define __Pyx_CAPI_PyList_Extend PyList_Extend
    #define __Pyx_CAPI_PyList_Clear PyList_Clear
    #endif
    

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    
#include <stddef.h>

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result)
    {
        int res;
        PyObject *key_obj = PyUnicode_FromString(key);
        if (key_obj == NULL) {
            *result = NULL;
            return -1;
        }
        res = __Pyx_PyDict_GetItemRef(mp, key_obj, result);
        Py_DECREF(key_obj);
        return res;
    }
    #else
    #define __Pyx_CAPI_PyDict_GetItemStringRef PyDict_GetItemStringRef
    #endif
    #if PY_VERSION_HEX < 0x030d0000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030F0000)
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value,
                        PyObject **result)
    {
        PyObject *value;
        if (__Pyx_PyDict_GetItemRef(d, key, &value) < 0) {
            // get error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (value != NULL) {
            // present
            if (result) {
                *result = value;
            }
            else {
                Py_DECREF(value);
            }
            return 1;
        }

        // missing: set the item
        if (PyDict_SetItem(d, key, default_value) < 0) {
            // set error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (result) {
            Py_INCREF(default_value);
            *result = default_value;
        }
        return 0;
    }
    #else
    #define __Pyx_CAPI_PyDict_SetDefaultRef PyDict_SetDefaultRef
    #endif
    

    #if PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
    {
        PyObject *obj = PyWeakref_GetObject(ref);
        if (obj == NULL) {
            // SystemError if ref is NULL
            *pobj = NULL;
            return -1;
        }
        if (obj == Py_None) {
            *pobj = NULL;
            return 0;
        }
        Py_INCREF(obj);
        *pobj = obj;
        return 1;
    }
    #else
    #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef
    #endif
    
#include "pythread.h"

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    

    #if CYTHON_COMPILING_IN_LIMITED_API
    #ifdef _MSC_VER
    #pragma message ("This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.")
    #else
    #warning This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.
    #endif
    #endif
    
#include "datetime.h"

    #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)         PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second,             microsecond, tz, fold, PyDateTimeAPI->DateTimeType)
    #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)         PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType)

    #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC
    #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name)

    /* Backport for Python < 3.10 */
    #if PY_VERSION_HEX < 0x030a00a1
        #ifndef PyDateTime_TIME_GET_TZINFO
            #define PyDateTime_TIME_GET_TZINFO(o)                 ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None)
        #endif
        #ifndef PyDateTime_DATE_GET_TZINFO
            #define PyDateTime_DATE_GET_TZINFO(o)                 ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None)
        #endif
    #endif
    

    #include <memory>
    #include <string>
    #include <string_view>
    #include <utility>

    namespace arrow {
    namespace py {

    template <typename T>
    std::shared_ptr<T> to_shared(std::unique_ptr<T>& t) {
        return std::move(t);
    }
    template <typename T>
    std::shared_ptr<T> to_shared(std::unique_ptr<T>&& t) {
        return std::move(t);
    }

    // Needed until https://github.com/cython/cython/issues/6651 is fixed
    inline std::string to_string(std::string_view s) {
        return std::string(s);
    }

    }  // namespace py
    }  // namespace arrow
    
#include "arrow/python/platform.h"
#include <Python.h>
#include "arrow/api.h"
#include "arrow/result.h"
#include "arrow/util/future.h"
#include "arrow/python/async.h"
#include "arrow/python/common.h"
#include "arrow/util/key_value_metadata.h"
#include "arrow/util/decimal.h"
#include "arrow/config.h"
#include <variant>
#include "arrow/c/dlpack_abi.h"
#include "arrow/c/dlpack.h"
#include "arrow/builder.h"
#include "arrow/util/cancel.h"
#include "arrow/io/api.h"
#include "arrow/ipc/api.h"
#include "arrow/util/value_parsing.h"
#include "arrow/csv/api.h"
#include "arrow/json/options.h"
#include "arrow/json/reader.h"
#include "arrow/util/thread_pool.h"
#include "arrow/compute/api.h"

    #include "arrow/compute/function.h"
    namespace arrow {
    namespace compute {
    namespace internal {
    Result<std::unique_ptr<FunctionOptions>> DeserializeFunctionOptions(
        const Buffer& buffer);
    } //  namespace internal
    } //  namespace compute
    } //  namespace arrow
    

    #include <unordered_map>

    #include "arrow/type.h"
    #include "arrow/datum.h"

    namespace arrow {
    namespace compute {
    struct KnownFieldValues {
      std::unordered_map<FieldRef, Datum, FieldRef::Hash> map;
    };
    } //  namespace compute
    } //  namespace arrow
    
#include "arrow/compute/expression.h"
#include "arrow/extension_type.h"
#include "arrow/extension/json.h"
#include "arrow/extension/uuid.h"
#include "arrow/extension/fixed_shape_tensor.h"
#include "arrow/extension/opaque.h"
#include "arrow/extension/bool8.h"
#include "arrow/util/compression.h"
#include "arrow/util/io_util.h"
#include "arrow/util/iterator.h"
#include "arrow/util/secure_string.h"
#include "arrow/array/concatenate.h"
#include "arrow/c/abi.h"
#include "arrow/c/bridge.h"
#include "arrow/util/byte_size.h"
#include "arrow/python/udf.h"
#include "arrow/compute/cast.h"
#include "arrow/acero/options.h"
#include "arrow/acero/exec_plan.h"
#include "arrow/python/csv.h"
#include "arrow/python/api.h"
#include "arrow/python/arrow_to_pandas.h"
#include "arrow/python/numpy_init.h"
#include "arrow/python/pyarrow.h"
#include "arrow/python/inference.h"
#include "arrow/python/ipc.h"
#include "arrow/python/extension_type.h"
#include "arrow/python/benchmark.h"
#include "arrow/python/gdb.h"
#include "arrow/python/helpers.h"
#include "arrow/python/config.h"
#include "arrow/filesystem/api.h"
#include "arrow/python/filesystem.h"
#include "arrow/dataset/plan.h"
#include "arrow/dataset/api.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#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 CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
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_Long(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_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "pyarrow/_dataset.pyx",
  "string.from_py",
  "cpython/contextvars.pxd",
  "cpython/datetime.pxd",
  "pyarrow/_dataset.pxd",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
  "pyarrow/lib.pxd",
  "pyarrow/_fs.pxd",
  "pyarrow/_acero.pxd",
  "pyarrow/_compute.pxd",
  "pyarrow/_csv.pxd",
  "pyarrow/_json.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#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()

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_7pyarrow_3lib__Weakrefable;
struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions;
struct __pyx_obj_7pyarrow_3lib_IpcReadOptions;
struct __pyx_obj_7pyarrow_3lib_Message;
struct __pyx_obj_7pyarrow_3lib_MemoryPool;
struct __pyx_obj_7pyarrow_3lib_DataType;
struct __pyx_obj_7pyarrow_3lib_ListType;
struct __pyx_obj_7pyarrow_3lib_LargeListType;
struct __pyx_obj_7pyarrow_3lib_ListViewType;
struct __pyx_obj_7pyarrow_3lib_LargeListViewType;
struct __pyx_obj_7pyarrow_3lib_MapType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListType;
struct __pyx_obj_7pyarrow_3lib_StructType;
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo;
struct __pyx_obj_7pyarrow_3lib_DictionaryType;
struct __pyx_obj_7pyarrow_3lib_TimestampType;
struct __pyx_obj_7pyarrow_3lib_Time32Type;
struct __pyx_obj_7pyarrow_3lib_Time64Type;
struct __pyx_obj_7pyarrow_3lib_DurationType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType;
struct __pyx_obj_7pyarrow_3lib_Decimal32Type;
struct __pyx_obj_7pyarrow_3lib_Decimal64Type;
struct __pyx_obj_7pyarrow_3lib_Decimal128Type;
struct __pyx_obj_7pyarrow_3lib_Decimal256Type;
struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType;
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType;
struct __pyx_obj_7pyarrow_3lib_ExtensionType;
struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType;
struct __pyx_obj_7pyarrow_3lib_Bool8Type;
struct __pyx_obj_7pyarrow_3lib_OpaqueType;
struct __pyx_obj_7pyarrow_3lib_UuidType;
struct __pyx_obj_7pyarrow_3lib_JsonType;
struct __pyx_obj_7pyarrow_3lib__Metadata;
struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata;
struct __pyx_obj_7pyarrow_3lib_Field;
struct __pyx_obj_7pyarrow_3lib_Schema;
struct __pyx_obj_7pyarrow_3lib_Scalar;
struct __pyx_obj_7pyarrow_3lib_ArrayStatistics;
struct __pyx_obj_7pyarrow_3lib__PandasConvertible;
struct __pyx_obj_7pyarrow_3lib_Array;
struct __pyx_obj_7pyarrow_3lib_Tensor;
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix;
struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix;
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor;
struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor;
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_Decimal32Array;
struct __pyx_obj_7pyarrow_3lib_Decimal64Array;
struct __pyx_obj_7pyarrow_3lib_Decimal128Array;
struct __pyx_obj_7pyarrow_3lib_Decimal256Array;
struct __pyx_obj_7pyarrow_3lib_StructArray;
struct __pyx_obj_7pyarrow_3lib_BaseListArray;
struct __pyx_obj_7pyarrow_3lib_ListArray;
struct __pyx_obj_7pyarrow_3lib_LargeListArray;
struct __pyx_obj_7pyarrow_3lib_ListViewArray;
struct __pyx_obj_7pyarrow_3lib_LargeListViewArray;
struct __pyx_obj_7pyarrow_3lib_MapArray;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray;
struct __pyx_obj_7pyarrow_3lib_UnionArray;
struct __pyx_obj_7pyarrow_3lib_StringArray;
struct __pyx_obj_7pyarrow_3lib_BinaryArray;
struct __pyx_obj_7pyarrow_3lib_StringViewArray;
struct __pyx_obj_7pyarrow_3lib_BinaryViewArray;
struct __pyx_obj_7pyarrow_3lib_DictionaryArray;
struct __pyx_obj_7pyarrow_3lib_ExtensionArray;
struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray;
struct __pyx_obj_7pyarrow_3lib_ChunkedArray;
struct __pyx_obj_7pyarrow_3lib__Tabular;
struct __pyx_obj_7pyarrow_3lib_Table;
struct __pyx_obj_7pyarrow_3lib_RecordBatch;
struct __pyx_obj_7pyarrow_3lib_Device;
struct __pyx_obj_7pyarrow_3lib_MemoryManager;
struct __pyx_obj_7pyarrow_3lib_Buffer;
struct __pyx_obj_7pyarrow_3lib_ResizableBuffer;
struct __pyx_obj_7pyarrow_3lib_NativeFile;
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream;
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream;
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter;
struct __pyx_obj_7pyarrow_3lib_RecordBatchReader;
struct __pyx_obj_7pyarrow_3lib_CacheOptions;
struct __pyx_obj_7pyarrow_3lib_Codec;
struct __pyx_obj_7pyarrow_3lib_StopToken;
struct __pyx_obj_7pyarrow_3_fs_FileInfo;
struct __pyx_obj_7pyarrow_3_fs_FileSelector;
struct __pyx_obj_7pyarrow_3_fs_FileSystem;
struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem;
struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem;
struct __pyx_obj_7pyarrow_3_fs__MockFileSystem;
struct __pyx_obj_7pyarrow_3_fs_PyFileSystem;
struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions;
struct __pyx_obj_7pyarrow_6_acero_Declaration;
struct __pyx_obj_7pyarrow_8_compute_UdfContext;
struct __pyx_obj_7pyarrow_8_compute_FunctionOptions;
struct __pyx_obj_7pyarrow_8_compute__SortOptions;
struct __pyx_obj_7pyarrow_8_compute_Expression;
struct __pyx_obj_7pyarrow_4_csv_ConvertOptions;
struct __pyx_obj_7pyarrow_4_csv_ParseOptions;
struct __pyx_obj_7pyarrow_4_csv_ReadOptions;
struct __pyx_obj_7pyarrow_4_csv_WriteOptions;
struct __pyx_obj_7pyarrow_5_json_ParseOptions;
struct __pyx_obj_7pyarrow_5_json_ReadOptions;
struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory;
struct __pyx_obj_7pyarrow_8_dataset_Dataset;
struct __pyx_obj_7pyarrow_8_dataset_Scanner;
struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions;
struct __pyx_obj_7pyarrow_8_dataset_FileFormat;
struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions;
struct __pyx_obj_7pyarrow_8_dataset_Fragment;
struct __pyx_obj_7pyarrow_8_dataset_FileFragment;
struct __pyx_obj_7pyarrow_8_dataset_Partitioning;
struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory;
struct __pyx_obj_7pyarrow_8_dataset_WrittenFile;
struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset;
struct __pyx_obj_7pyarrow_8_dataset_UnionDataset;
struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset;
struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions;
struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat;
struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat;
struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat;
struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions;
struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions;
struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat;
struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions;
struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning;
struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning;
struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning;
struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning;
struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions;
struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory;
struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory;
struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator;
struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator;
struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions;
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments;
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};
struct __pyx_opt_args_7cpython_8datetime_time_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_new;
struct __pyx_opt_args_7cpython_8datetime_timezone_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp;

/* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_time_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_timezone_new {
  int __pyx_n;
  PyObject *name;
};

/* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
  int __pyx_n;
  PyObject *tz;
};

/* "pyarrow/includes/libarrow.pxd":1560
 * 
 * # Use typedef to emulate syntax for std::function<void(..)>
 * ctypedef void CallbackTransform(object, const shared_ptr[CBuffer]& src,             # <<<<<<<<<<<<<<
 *                                 shared_ptr[CBuffer]* dest)
 * 
*/
typedef void __pyx_t_7pyarrow_8includes_8libarrow_CallbackTransform(PyObject *, std::shared_ptr< arrow::Buffer>  const &, std::shared_ptr< arrow::Buffer>  *);

/* "pyarrow/includes/libarrow.pxd":1563
 *                                 shared_ptr[CBuffer]* dest)
 * 
 * ctypedef CResult[shared_ptr[CInputStream]] StreamWrapFunc(             # <<<<<<<<<<<<<<
 *     shared_ptr[CInputStream])
 * 
*/
typedef arrow::Result<std::shared_ptr< arrow::io::InputStream> >  __pyx_t_7pyarrow_8includes_8libarrow_StreamWrapFunc(std::shared_ptr< arrow::io::InputStream> );

/* "pyarrow/includes/libarrow.pxd":3239
 *     int64_t TotalBufferSize(const CTable& table)
 * 
 * ctypedef PyObject* CallbackUdf(object user_function, const CUdfContext& context, object inputs)             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef PyObject *__pyx_t_7pyarrow_8includes_8libarrow_CallbackUdf(PyObject *,  arrow::py::UdfContext const &, PyObject *);

/* "pyarrow/includes/libarrow_python.pxd":24
 * 
 * 
 * ctypedef CInvalidRowResult PyInvalidRowCallback(object,             # <<<<<<<<<<<<<<
 *                                                 const CCSVInvalidRow&)
 * 
*/
typedef  arrow::csv::InvalidRowResult __pyx_t_7pyarrow_8includes_15libarrow_python_PyInvalidRowCallback(PyObject *,  arrow::csv::InvalidRow const &);

/* "pyarrow/includes/libarrow_fs.pxd":312
 * # Callbacks for implementing Python filesystems
 * # Use typedef to emulate syntax for std::function<void(..)>
 * ctypedef void CallbackGetTypeName(object, c_string*)             # <<<<<<<<<<<<<<
 * ctypedef c_bool CallbackEquals(object, const CFileSystem&)
 * 
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackGetTypeName(PyObject *, std::string *);

/* "pyarrow/includes/libarrow_fs.pxd":313
 * # Use typedef to emulate syntax for std::function<void(..)>
 * ctypedef void CallbackGetTypeName(object, c_string*)
 * ctypedef c_bool CallbackEquals(object, const CFileSystem&)             # <<<<<<<<<<<<<<
 * 
 * ctypedef void CallbackGetFileInfo(object, const c_string&, CFileInfo*)
*/
typedef bool __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackEquals(PyObject *, arrow::fs::FileSystem const &);

/* "pyarrow/includes/libarrow_fs.pxd":315
 * ctypedef c_bool CallbackEquals(object, const CFileSystem&)
 * 
 * ctypedef void CallbackGetFileInfo(object, const c_string&, CFileInfo*)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackGetFileInfoVector(object, const vector[c_string]&,
 *                                         vector[CFileInfo]*)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackGetFileInfo(PyObject *, std::string const &, arrow::fs::FileInfo *);

/* "pyarrow/includes/libarrow_fs.pxd":316
 * 
 * ctypedef void CallbackGetFileInfo(object, const c_string&, CFileInfo*)
 * ctypedef void CallbackGetFileInfoVector(object, const vector[c_string]&,             # <<<<<<<<<<<<<<
 *                                         vector[CFileInfo]*)
 * ctypedef void CallbackGetFileInfoSelector(object, const CFileSelector&,
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackGetFileInfoVector(PyObject *, std::vector<std::string>  const &, std::vector<arrow::fs::FileInfo>  *);

/* "pyarrow/includes/libarrow_fs.pxd":318
 * ctypedef void CallbackGetFileInfoVector(object, const vector[c_string]&,
 *                                         vector[CFileInfo]*)
 * ctypedef void CallbackGetFileInfoSelector(object, const CFileSelector&,             # <<<<<<<<<<<<<<
 *                                           vector[CFileInfo]*)
 * ctypedef void CallbackCreateDir(object, const c_string&, c_bool)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackGetFileInfoSelector(PyObject *, arrow::fs::FileSelector const &, std::vector<arrow::fs::FileInfo>  *);

/* "pyarrow/includes/libarrow_fs.pxd":320
 * ctypedef void CallbackGetFileInfoSelector(object, const CFileSelector&,
 *                                           vector[CFileInfo]*)
 * ctypedef void CallbackCreateDir(object, const c_string&, c_bool)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackDeleteDir(object, const c_string&)
 * ctypedef void CallbackDeleteDirContents(object, const c_string&, c_bool)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackCreateDir(PyObject *, std::string const &, bool);

/* "pyarrow/includes/libarrow_fs.pxd":321
 *                                           vector[CFileInfo]*)
 * ctypedef void CallbackCreateDir(object, const c_string&, c_bool)
 * ctypedef void CallbackDeleteDir(object, const c_string&)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackDeleteDirContents(object, const c_string&, c_bool)
 * ctypedef void CallbackDeleteRootDirContents(object)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackDeleteDir(PyObject *, std::string const &);

/* "pyarrow/includes/libarrow_fs.pxd":322
 * ctypedef void CallbackCreateDir(object, const c_string&, c_bool)
 * ctypedef void CallbackDeleteDir(object, const c_string&)
 * ctypedef void CallbackDeleteDirContents(object, const c_string&, c_bool)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackDeleteRootDirContents(object)
 * ctypedef void CallbackDeleteFile(object, const c_string&)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackDeleteDirContents(PyObject *, std::string const &, bool);

/* "pyarrow/includes/libarrow_fs.pxd":323
 * ctypedef void CallbackDeleteDir(object, const c_string&)
 * ctypedef void CallbackDeleteDirContents(object, const c_string&, c_bool)
 * ctypedef void CallbackDeleteRootDirContents(object)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackDeleteFile(object, const c_string&)
 * ctypedef void CallbackMove(object, const c_string&, const c_string&)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackDeleteRootDirContents(PyObject *);

/* "pyarrow/includes/libarrow_fs.pxd":324
 * ctypedef void CallbackDeleteDirContents(object, const c_string&, c_bool)
 * ctypedef void CallbackDeleteRootDirContents(object)
 * ctypedef void CallbackDeleteFile(object, const c_string&)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackMove(object, const c_string&, const c_string&)
 * ctypedef void CallbackCopyFile(object, const c_string&, const c_string&)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackDeleteFile(PyObject *, std::string const &);

/* "pyarrow/includes/libarrow_fs.pxd":325
 * ctypedef void CallbackDeleteRootDirContents(object)
 * ctypedef void CallbackDeleteFile(object, const c_string&)
 * ctypedef void CallbackMove(object, const c_string&, const c_string&)             # <<<<<<<<<<<<<<
 * ctypedef void CallbackCopyFile(object, const c_string&, const c_string&)
 * 
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackMove(PyObject *, std::string const &, std::string const &);

/* "pyarrow/includes/libarrow_fs.pxd":326
 * ctypedef void CallbackDeleteFile(object, const c_string&)
 * ctypedef void CallbackMove(object, const c_string&, const c_string&)
 * ctypedef void CallbackCopyFile(object, const c_string&, const c_string&)             # <<<<<<<<<<<<<<
 * 
 * ctypedef void CallbackOpenInputStream(object, const c_string&,
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackCopyFile(PyObject *, std::string const &, std::string const &);

/* "pyarrow/includes/libarrow_fs.pxd":328
 * ctypedef void CallbackCopyFile(object, const c_string&, const c_string&)
 * 
 * ctypedef void CallbackOpenInputStream(object, const c_string&,             # <<<<<<<<<<<<<<
 *                                       shared_ptr[CInputStream]*)
 * ctypedef void CallbackOpenInputFile(object, const c_string&,
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackOpenInputStream(PyObject *, std::string const &, std::shared_ptr< arrow::io::InputStream>  *);

/* "pyarrow/includes/libarrow_fs.pxd":330
 * ctypedef void CallbackOpenInputStream(object, const c_string&,
 *                                       shared_ptr[CInputStream]*)
 * ctypedef void CallbackOpenInputFile(object, const c_string&,             # <<<<<<<<<<<<<<
 *                                     shared_ptr[CRandomAccessFile]*)
 * ctypedef void CallbackOpenOutputStream(
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackOpenInputFile(PyObject *, std::string const &, std::shared_ptr< arrow::io::RandomAccessFile>  *);

/* "pyarrow/includes/libarrow_fs.pxd":332
 * ctypedef void CallbackOpenInputFile(object, const c_string&,
 *                                     shared_ptr[CRandomAccessFile]*)
 * ctypedef void CallbackOpenOutputStream(             # <<<<<<<<<<<<<<
 *     object, const c_string&, const shared_ptr[const CKeyValueMetadata]&,
 *     shared_ptr[COutputStream]*)
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackOpenOutputStream(PyObject *, std::string const &, std::shared_ptr< arrow::KeyValueMetadata const >  const &, std::shared_ptr< arrow::io::OutputStream>  *);

/* "pyarrow/includes/libarrow_fs.pxd":335
 *     object, const c_string&, const shared_ptr[const CKeyValueMetadata]&,
 *     shared_ptr[COutputStream]*)
 * ctypedef void CallbackNormalizePath(object, const c_string&, c_string*)             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "arrow/python/filesystem.h" namespace "arrow::py::fs" nogil:
*/
typedef void __pyx_t_7pyarrow_8includes_11libarrow_fs_CallbackNormalizePath(PyObject *, std::string const &, std::string *);

/* "pyarrow/includes/libarrow_dataset.pxd":34
 * 
 * 
 * ctypedef CStatus cb_writer_finish_internal(CFileWriter*)             # <<<<<<<<<<<<<<
 * ctypedef void cb_writer_finish(dict, CFileWriter*)
 * 
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_16libarrow_dataset_cb_writer_finish_internal(arrow::dataset::FileWriter *);

/* "pyarrow/includes/libarrow_dataset.pxd":35
 * 
 * ctypedef CStatus cb_writer_finish_internal(CFileWriter*)
 * ctypedef void cb_writer_finish(dict, CFileWriter*)             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "arrow/dataset/api.h" namespace "arrow::dataset" nogil:
*/
typedef void __pyx_t_7pyarrow_8includes_16libarrow_dataset_cb_writer_finish(PyObject *, arrow::dataset::FileWriter *);
struct __pyx_opt_args_7pyarrow_3lib_ensure_type;

/* "pyarrow/lib.pxd":676
 * 
 * # Default is allow_none=False
 * cpdef DataType ensure_type(object type, bint allow_none=*)             # <<<<<<<<<<<<<<
 * 
 * cdef DataType primitive_type(Type type)
*/
struct __pyx_opt_args_7pyarrow_3lib_ensure_type {
  int __pyx_n;
  int allow_none;
};

/* "pyarrow/_fs.pxd":26
 * 
 * 
 * cpdef enum FileType:             # <<<<<<<<<<<<<<
 *     NotFound = <int8_t> CFileType_NotFound
 *     Unknown = <int8_t> CFileType_Unknown
*/
enum __pyx_t_7pyarrow_3_fs_FileType {

  /* "pyarrow/_fs.pxd":30
 *     Unknown = <int8_t> CFileType_Unknown
 *     File = <int8_t> CFileType_File
 *     Directory = <int8_t> CFileType_Directory             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_e_7pyarrow_3_fs_NotFound = ((int8_t)arrow::fs::FileType::NotFound),
  __pyx_e_7pyarrow_3_fs_Unknown = ((int8_t)arrow::fs::FileType::Unknown),
  __pyx_e_7pyarrow_3_fs_File = ((int8_t)arrow::fs::FileType::File),
  __pyx_e_7pyarrow_3_fs_Directory = ((int8_t)arrow::fs::FileType::Directory)
};
struct __pyx_opt_args_7pyarrow_8_compute_unwrap_sort_keys;

/* "pyarrow/_compute.pxd":68
 * cdef CFieldRef _ensure_field_ref(value) except *
 * 
 * cdef vector[CSortKey] unwrap_sort_keys(sort_keys, allow_str=*) except *             # <<<<<<<<<<<<<<
 * 
 * cdef CSortOrder unwrap_sort_order(order) except *
*/
struct __pyx_opt_args_7pyarrow_8_compute_unwrap_sort_keys {
  int __pyx_n;
  PyObject *allow_str;
};
struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source;
struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder;

/* "pyarrow/_dataset.pxd":28
 * 
 * 
 * cdef CFileSource _make_file_source(object file, FileSystem filesystem=*, object file_size=*)             # <<<<<<<<<<<<<<
 * 
 * cdef class DatasetFactory(_Weakrefable):
*/
struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source {
  int __pyx_n;
  struct __pyx_obj_7pyarrow_3_fs_FileSystem *filesystem;
  PyObject *file_size;
};

/* "pyarrow/_dataset.pyx":3532
 * 
 * 
 * cdef void _populate_builder(const shared_ptr[CScannerBuilder]& ptr,             # <<<<<<<<<<<<<<
 *                             object columns=None, Expression filter=None,
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
*/
struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder {
  int __pyx_n;
  PyObject *columns;
  struct __pyx_obj_7pyarrow_8_compute_Expression *filter;
  int batch_size;
  int batch_readahead;
  int fragment_readahead;
  int use_threads;
  int cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *memory_pool;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *fragment_scan_options;
};

/* "pyarrow/lib.pxd":37
 * 
 * 
 * cdef class _Weakrefable:             # <<<<<<<<<<<<<<
 *     cdef object __weakref__
 * 
*/
struct __pyx_obj_7pyarrow_3lib__Weakrefable {
  PyObject_HEAD
  PyObject *__weakref__;
};


/* "pyarrow/lib.pxd":41
 * 
 * 
 * cdef class IpcWriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcWriteOptions c_options
*/
struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::ipc::IpcWriteOptions c_options;
};


/* "pyarrow/lib.pxd":49
 * 
 * 
 * cdef class IpcReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcReadOptions c_options
*/
struct __pyx_obj_7pyarrow_3lib_IpcReadOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::ipc::IpcReadOptions c_options;
};


/* "pyarrow/lib.pxd":60
 * 
 * 
 * cdef class Message(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CMessage] message
*/
struct __pyx_obj_7pyarrow_3lib_Message {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::ipc::Message>  message;
};


/* "pyarrow/lib.pxd":65
 * 
 * 
 * cdef class MemoryPool(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
*/
struct __pyx_obj_7pyarrow_3lib_MemoryPool {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtab;
   arrow::MemoryPool *pool;
};


/* "pyarrow/lib.pxd":78
 * 
 * 
 * cdef class DataType(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
*/
struct __pyx_obj_7pyarrow_3lib_DataType {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtab;
  std::shared_ptr< arrow::DataType>  sp_type;
   arrow::DataType *type;
  PyObject *pep3118_format;
};


/* "pyarrow/lib.pxd":88
 * 
 * 
 * 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":93
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListType* list_type
*/
struct __pyx_obj_7pyarrow_3lib_LargeListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::LargeListType const *list_type;
};


/* "pyarrow/lib.pxd":98
 * 
 * 
 * cdef class ListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListViewType* list_view_type
*/
struct __pyx_obj_7pyarrow_3lib_ListViewType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ListViewType const *list_view_type;
};


/* "pyarrow/lib.pxd":103
 * 
 * 
 * cdef class LargeListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListViewType* list_view_type
*/
struct __pyx_obj_7pyarrow_3lib_LargeListViewType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::LargeListViewType const *list_view_type;
};


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


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


/* "pyarrow/lib.pxd":118
 * 
 * 
 * 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":125
 * 
 * 
 * cdef class DictionaryMemo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Even though the CDictionaryMemo instance is private, we allocate
*/
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::shared_ptr< arrow::ipc::DictionaryMemo>  sp_memo;
   arrow::ipc::DictionaryMemo *memo;
};


/* "pyarrow/lib.pxd":133
 * 
 * 
 * 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":138
 * 
 * 
 * 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":143
 * 
 * 
 * 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":148
 * 
 * 
 * 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":153
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDurationType* duration_type
*/
struct __pyx_obj_7pyarrow_3lib_DurationType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::DurationType const *duration_type;
};


/* "pyarrow/lib.pxd":158
 * 
 * 
 * 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":163
 * 
 * 
 * cdef class Decimal32Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal32Type* decimal32_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal32Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal32Type const *decimal32_type;
};


/* "pyarrow/lib.pxd":168
 * 
 * 
 * cdef class Decimal64Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal64Type* decimal64_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal64Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal64Type const *decimal64_type;
};


/* "pyarrow/lib.pxd":173
 * 
 * 
 * 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":178
 * 
 * 
 * cdef class Decimal256Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal256Type* decimal256_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal256Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal256Type const *decimal256_type;
};


/* "pyarrow/lib.pxd":183
 * 
 * 
 * cdef class RunEndEncodedType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CRunEndEncodedType* run_end_encoded_type
*/
struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::RunEndEncodedType const *run_end_encoded_type;
};


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


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


/* "pyarrow/lib.pxd":198
 * 
 * 
 * cdef class FixedShapeTensorType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedShapeTensorType* tensor_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::FixedShapeTensorType const *tensor_ext_type;
};


/* "pyarrow/lib.pxd":202
 *         const CFixedShapeTensorType* tensor_ext_type
 * 
 * cdef class Bool8Type(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CBool8Type* bool8_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_Bool8Type {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::Bool8Type const *bool8_ext_type;
};


/* "pyarrow/lib.pxd":206
 *         const CBool8Type* bool8_ext_type
 * 
 * cdef class OpaqueType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const COpaqueType* opaque_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_OpaqueType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::OpaqueType const *opaque_ext_type;
};


/* "pyarrow/lib.pxd":210
 *         const COpaqueType* opaque_ext_type
 * 
 * cdef class UuidType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CUuidType* uuid_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_UuidType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::UuidType const *uuid_ext_type;
};


/* "pyarrow/lib.pxd":214
 *         const CUuidType* uuid_ext_type
 * 
 * cdef class JsonType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CJsonType* json_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_JsonType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::JsonExtensionType const *json_ext_type;
};


/* "pyarrow/lib.pxd":219
 * 
 * 
 * cdef class _Metadata(_Weakrefable):             # <<<<<<<<<<<<<<
 *     # required because KeyValueMetadata also extends collections.abc.Mapping
 *     # and the first parent class must be an extension type
*/
struct __pyx_obj_7pyarrow_3lib__Metadata {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/lib.pxd":225
 * 
 * 
 * cdef class KeyValueMetadata(_Metadata):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[const CKeyValueMetadata] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata {
  struct __pyx_obj_7pyarrow_3lib__Metadata __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata *__pyx_vtab;
  std::shared_ptr< arrow::KeyValueMetadata const >  wrapped;
   arrow::KeyValueMetadata const *metadata;
};


/* "pyarrow/lib.pxd":237
 * 
 * 
 * cdef class Field(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
*/
struct __pyx_obj_7pyarrow_3lib_Field {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  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":248
 * 
 * 
 * cdef class Schema(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
*/
struct __pyx_obj_7pyarrow_3lib_Schema {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtab;
  std::shared_ptr< arrow::Schema>  sp_schema;
   arrow::Schema *schema;
};


/* "pyarrow/lib.pxd":257
 * 
 * 
 * cdef class Scalar(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_Scalar {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Scalar *__pyx_vtab;
  std::shared_ptr< arrow::Scalar>  wrapped;
};


/* "pyarrow/lib.pxd":269
 * 
 * 
 * cdef class ArrayStatistics(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArrayStatistics] sp_statistics
*/
struct __pyx_obj_7pyarrow_3lib_ArrayStatistics {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics *__pyx_vtab;
  std::shared_ptr< arrow::ArrayStatistics>  sp_statistics;
};


/* "pyarrow/lib.pxd":277
 * 
 * 
 * cdef class _PandasConvertible(_Weakrefable):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib__PandasConvertible {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/lib.pxd":281
 * 
 * 
 * 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;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":297
 * 
 * 
 * cdef class Tensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_tensor
*/
struct __pyx_obj_7pyarrow_3lib_Tensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  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;
  PyObject *_ssize_t_shape;
  PyObject *_ssize_t_strides;
};


/* "pyarrow/lib.pxd":310
 * 
 * 
 * cdef class SparseCSRMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSRMatrix] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSRMatrix>  sp_sparse_tensor;
   arrow::SparseCSRMatrix *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":321
 * 
 * 
 * cdef class SparseCSCMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSCMatrix] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSCMatrix>  sp_sparse_tensor;
   arrow::SparseCSCMatrix *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":332
 * 
 * 
 * cdef class SparseCOOTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCOOTensor] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *__pyx_vtab;
  std::shared_ptr< arrow::SparseCOOTensor>  sp_sparse_tensor;
   arrow::SparseCOOTensor *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":343
 * 
 * 
 * cdef class SparseCSFTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSFTensor] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSFTensor>  sp_sparse_tensor;
   arrow::SparseCSFTensor *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


/* "pyarrow/lib.pxd":422
 * 
 * 
 * cdef class Decimal32Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal32Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":426
 * 
 * 
 * cdef class Decimal64Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal64Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


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


/* "pyarrow/lib.pxd":434
 * 
 * 
 * cdef class Decimal256Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal256Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


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


/* "pyarrow/lib.pxd":442
 * 
 * 
 * cdef class BaseListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BaseListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":446
 * 
 * 
 * cdef class ListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":450
 * 
 * 
 * cdef class LargeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_LargeListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":454
 * 
 * 
 * cdef class ListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ListViewArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":458
 * 
 * 
 * cdef class LargeListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_LargeListViewArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":462
 * 
 * 
 * cdef class MapArray(ListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_MapArray {
  struct __pyx_obj_7pyarrow_3lib_ListArray __pyx_base;
};


/* "pyarrow/lib.pxd":466
 * 
 * 
 * cdef class FixedSizeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


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


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


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


/* "pyarrow/lib.pxd":482
 * 
 * 
 * cdef class StringViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_StringViewArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":486
 * 
 * 
 * cdef class BinaryViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BinaryViewArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":490
 * 
 * 
 * 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":495
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ExtensionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":499
 * 
 * 
 * cdef class MonthDayNanoIntervalArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":507
 * 
 * 
 * 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;
  bool _is_cpu;
  bool _init_is_cpu;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":522
 * 
 * 
 * cdef class _Tabular(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef void _assert_cpu(self) except *
 * 
*/
struct __pyx_obj_7pyarrow_3lib__Tabular {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular *__pyx_vtab;
};


/* "pyarrow/lib.pxd":526
 * 
 * 
 * cdef class Table(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
*/
struct __pyx_obj_7pyarrow_3lib_Table {
  struct __pyx_obj_7pyarrow_3lib__Tabular __pyx_base;
  std::shared_ptr< arrow::Table>  sp_table;
   arrow::Table *table;
  bool _is_cpu;
  bool _init_is_cpu;
};


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


/* "pyarrow/lib.pxd":545
 * 
 * 
 * cdef class Device(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDevice] device
*/
struct __pyx_obj_7pyarrow_3lib_Device {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Device *__pyx_vtab;
  std::shared_ptr< arrow::Device>  device;
};


/* "pyarrow/lib.pxd":557
 * 
 * 
 * cdef class MemoryManager(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CMemoryManager] memory_manager
*/
struct __pyx_obj_7pyarrow_3lib_MemoryManager {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager *__pyx_vtab;
  std::shared_ptr< arrow::MemoryManager>  memory_manager;
};


/* "pyarrow/lib.pxd":569
 * 
 * 
 * cdef class Buffer(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
*/
struct __pyx_obj_7pyarrow_3lib_Buffer {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  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":579
 * 
 * 
 * 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":584
 * 
 * 
 * cdef class NativeFile(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] input_stream
*/
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  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 _is_appending;
  int own_file;
};


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


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


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


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


/* "pyarrow/lib.pxd":624
 * 
 * 
 * cdef class _CRecordBatchWriter(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         SharedPtrNoGIL[CRecordBatchWriter] writer
*/
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  arrow::py::SharedPtrNoGIL< arrow::ipc::RecordBatchWriter>  writer;
};


/* "pyarrow/lib.pxd":629
 * 
 * 
 * cdef class RecordBatchReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         SharedPtrNoGIL[CRecordBatchReader] reader
*/
struct __pyx_obj_7pyarrow_3lib_RecordBatchReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  arrow::py::SharedPtrNoGIL< arrow::RecordBatchReader>  reader;
};


/* "pyarrow/lib.pxd":634
 * 
 * 
 * cdef class CacheOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCacheOptions wrapped
*/
struct __pyx_obj_7pyarrow_3lib_CacheOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions *__pyx_vtab;
  arrow::io::CacheOptions wrapped;
};


/* "pyarrow/lib.pxd":646
 * 
 * 
 * cdef class Codec(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CCodec] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_Codec {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Codec *__pyx_vtab;
  std::shared_ptr< arrow::util::Codec>  wrapped;
};


/* "pyarrow/lib.pxd":654
 * 
 * # This class is only used internally for now
 * cdef class StopToken:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStopToken stop_token
*/
struct __pyx_obj_7pyarrow_3lib_StopToken {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_StopToken *__pyx_vtab;
  arrow::StopToken stop_token;
};


/* "pyarrow/_fs.pxd":33
 * 
 * 
 * cdef class FileInfo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CFileInfo info
*/
struct __pyx_obj_7pyarrow_3_fs_FileInfo {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo *__pyx_vtab;
  arrow::fs::FileInfo info;
};


/* "pyarrow/_fs.pxd":46
 * 
 * 
 * cdef class FileSelector(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CFileSelector selector
*/
struct __pyx_obj_7pyarrow_3_fs_FileSelector {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSelector *__pyx_vtab;
  arrow::fs::FileSelector selector;
};


/* "pyarrow/_fs.pxd":56
 * 
 * 
 * cdef class FileSystem(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CFileSystem] wrapped
*/
struct __pyx_obj_7pyarrow_3_fs_FileSystem {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *__pyx_vtab;
  std::shared_ptr<arrow::fs::FileSystem>  wrapped;
  arrow::fs::FileSystem *fs;
};


/* "pyarrow/_fs.pxd":69
 * 
 * 
 * cdef class LocalFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef init(self, const shared_ptr[CFileSystem]& wrapped)
 * 
*/
struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem __pyx_base;
};


/* "pyarrow/_fs.pxd":73
 * 
 * 
 * cdef class SubTreeFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CSubTreeFileSystem* subtreefs
*/
struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem __pyx_base;
  arrow::fs::SubTreeFileSystem *subtreefs;
};


/* "pyarrow/_fs.pxd":80
 * 
 * 
 * cdef class _MockFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMockFileSystem* mockfs
*/
struct __pyx_obj_7pyarrow_3_fs__MockFileSystem {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem __pyx_base;
  arrow::fs::internal::MockFileSystem *mockfs;
};


/* "pyarrow/_fs.pxd":87
 * 
 * 
 * cdef class PyFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CPyFileSystem* pyfs
*/
struct __pyx_obj_7pyarrow_3_fs_PyFileSystem {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem __pyx_base;
  arrow::py::fs::PyFileSystem *pyfs;
};


/* "pyarrow/_acero.pxd":26
 * 
 * 
 * cdef class ExecNodeOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CExecNodeOptions] wrapped
*/
struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions *__pyx_vtab;
  std::shared_ptr<arrow::acero::ExecNodeOptions>  wrapped;
};


/* "pyarrow/_acero.pxd":34
 * 
 * 
 * cdef class Declaration(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_6_acero_Declaration {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_6_acero_Declaration *__pyx_vtab;
  arrow::acero::Declaration decl;
};


/* "pyarrow/_compute.pxd":24
 * from pyarrow.includes.libarrow cimport *
 * 
 * cdef class UdfContext(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CUdfContext c_context
*/
struct __pyx_obj_7pyarrow_8_compute_UdfContext {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_compute_UdfContext *__pyx_vtab;
   arrow::py::UdfContext c_context;
};


/* "pyarrow/_compute.pxd":31
 * 
 * 
 * cdef class FunctionOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CFunctionOptions] wrapped
*/
struct __pyx_obj_7pyarrow_8_compute_FunctionOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_compute_FunctionOptions *__pyx_vtab;
  std::shared_ptr< arrow::compute::FunctionOptions>  wrapped;
};


/* "pyarrow/_compute.pxd":41
 * 
 * 
 * cdef class _SortOptions(FunctionOptions):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_8_compute__SortOptions {
  struct __pyx_obj_7pyarrow_8_compute_FunctionOptions __pyx_base;
};


/* "pyarrow/_compute.pxd":48
 * 
 * 
 * cdef class Expression(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_compute_Expression {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *__pyx_vtab;
  arrow::compute::Expression expr;
};


/* "pyarrow/_csv.pxd":24
 * 
 * 
 * cdef class ConvertOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVConvertOptions] options
*/
struct __pyx_obj_7pyarrow_4_csv_ConvertOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_4_csv_ConvertOptions *__pyx_vtab;
  std::unique_ptr< arrow::csv::ConvertOptions>  options;
};


/* "pyarrow/_csv.pxd":32
 * 
 * 
 * cdef class ParseOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVParseOptions] options
*/
struct __pyx_obj_7pyarrow_4_csv_ParseOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_4_csv_ParseOptions *__pyx_vtab;
  std::unique_ptr< arrow::csv::ParseOptions>  options;
  PyObject *_invalid_row_handler;
};


/* "pyarrow/_csv.pxd":41
 * 
 * 
 * cdef class ReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVReadOptions] options
*/
struct __pyx_obj_7pyarrow_4_csv_ReadOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_4_csv_ReadOptions *__pyx_vtab;
  std::unique_ptr< arrow::csv::ReadOptions>  options;
  PyObject *encoding;
};


/* "pyarrow/_csv.pxd":50
 * 
 * 
 * cdef class WriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVWriteOptions] options
*/
struct __pyx_obj_7pyarrow_4_csv_WriteOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_4_csv_WriteOptions *__pyx_vtab;
  std::unique_ptr< arrow::csv::WriteOptions>  options;
};


/* "pyarrow/_json.pxd":24
 * 
 * 
 * cdef class ParseOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CJSONParseOptions options
*/
struct __pyx_obj_7pyarrow_5_json_ParseOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_5_json_ParseOptions *__pyx_vtab;
   arrow::json::ParseOptions options;
};


/* "pyarrow/_json.pxd":31
 *     cdef ParseOptions wrap(CJSONParseOptions options)
 * 
 * cdef class ReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CJSONReadOptions options
*/
struct __pyx_obj_7pyarrow_5_json_ReadOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_5_json_ReadOptions *__pyx_vtab;
   arrow::json::ReadOptions options;
};


/* "pyarrow/_dataset.pxd":30
 * cdef CFileSource _make_file_source(object file, FileSystem filesystem=*, object file_size=*)
 * 
 * cdef class DatasetFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory *__pyx_vtab;
  arrow::py::SharedPtrNoGIL<arrow::dataset::DatasetFactory>  wrapped;
  arrow::dataset::DatasetFactory *factory;
};


/* "pyarrow/_dataset.pxd":44
 * 
 * 
 * cdef class Dataset(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_Dataset {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *__pyx_vtab;
  arrow::py::SharedPtrNoGIL<arrow::dataset::Dataset>  wrapped;
  arrow::dataset::Dataset *dataset;
  PyObject *_scan_options;
};


/* "pyarrow/_dataset.pxd":59
 * 
 * 
 * cdef class Scanner(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         SharedPtrNoGIL[CScanner] wrapped
*/
struct __pyx_obj_7pyarrow_8_dataset_Scanner {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Scanner *__pyx_vtab;
  arrow::py::SharedPtrNoGIL<arrow::dataset::Scanner>  wrapped;
  arrow::dataset::Scanner *scanner;
};


/* "pyarrow/_dataset.pxd":75
 * 
 * 
 * cdef class FragmentScanOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions *__pyx_vtab;
  std::shared_ptr<arrow::dataset::FragmentScanOptions>  wrapped;
};


/* "pyarrow/_dataset.pxd":86
 * 
 * 
 * cdef class FileFormat(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_FileFormat {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat *__pyx_vtab;
  std::shared_ptr<arrow::dataset::FileFormat>  wrapped;
  arrow::dataset::FileFormat *format;
};


/* "pyarrow/_dataset.pxd":107
 * 
 * 
 * cdef class FileWriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions *__pyx_vtab;
  std::shared_ptr<arrow::dataset::FileWriteOptions>  wrapped;
  arrow::dataset::FileWriteOptions *c_options;
};


/* "pyarrow/_dataset.pxd":121
 * 
 * 
 * cdef class Fragment(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_Fragment {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment *__pyx_vtab;
  arrow::py::SharedPtrNoGIL<arrow::dataset::Fragment>  wrapped;
  arrow::dataset::Fragment *fragment;
};


/* "pyarrow/_dataset.pxd":135
 * 
 * 
 * cdef class FileFragment(Fragment):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_FileFragment {
  struct __pyx_obj_7pyarrow_8_dataset_Fragment __pyx_base;
  arrow::dataset::FileFragment *file_fragment;
};


/* "pyarrow/_dataset.pxd":143
 * 
 * 
 * cdef class Partitioning(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_Partitioning {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning *__pyx_vtab;
  std::shared_ptr<arrow::dataset::Partitioning>  wrapped;
  arrow::dataset::Partitioning *partitioning;
};


/* "pyarrow/_dataset.pxd":157
 * 
 * 
 * cdef class PartitioningFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_PartitioningFactory *__pyx_vtab;
  std::shared_ptr<arrow::dataset::PartitioningFactory>  wrapped;
  arrow::dataset::PartitioningFactory *factory;
  PyObject *constructor;
  PyObject *options;
};


/* "pyarrow/_dataset.pxd":174
 * 
 * 
 * cdef class WrittenFile(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     # The full path to the created file
*/
struct __pyx_obj_7pyarrow_8_dataset_WrittenFile {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  PyObject *path;
  PyObject *metadata;
  int64_t size;
};


/* "pyarrow/_dataset.pyx":994
 * 
 * 
 * cdef class InMemoryDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset wrapping in-memory data.
*/
struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset __pyx_base;
  arrow::dataset::InMemoryDataset *in_memory_dataset;
};


/* "pyarrow/_dataset.pyx":1055
 * 
 * 
 * cdef class UnionDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset wrapping child datasets.
*/
struct __pyx_obj_7pyarrow_8_dataset_UnionDataset {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset __pyx_base;
  arrow::dataset::UnionDataset *union_dataset;
};


/* "pyarrow/_dataset.pyx":1098
 * 
 * 
 * cdef class FileSystemDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset of file fragments.
*/
struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset __pyx_base;
  arrow::dataset::FileSystemDataset *filesystem_dataset;
};


/* "pyarrow/_dataset.pyx":2119
 * 
 * 
 * cdef class IpcFileWriteOptions(FileWriteOptions):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcFileWriteOptions* ipc_options
*/
struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions {
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions __pyx_base;
  arrow::dataset::IpcFileWriteOptions *ipc_options;
};


/* "pyarrow/_dataset.pyx":2142
 * 
 * 
 * cdef class IpcFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/
struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat {
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat __pyx_base;
};


/* "pyarrow/_dataset.pyx":2182
 * 
 * 
 * cdef class FeatherFileFormat(IpcFileFormat):             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat {
  struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat __pyx_base;
};


/* "pyarrow/_dataset.pyx":2189
 * 
 * 
 * cdef class CsvFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 *     """
 *     FileFormat for CSV files.
*/
struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat {
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat __pyx_base;
  arrow::dataset::CsvFileFormat *csv_format;
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *_read_options_py;
};


/* "pyarrow/_dataset.pyx":2298
 * 
 * 
 * cdef class CsvFragmentScanOptions(FragmentScanOptions):             # <<<<<<<<<<<<<<
 *     """
 *     Scan-specific options for CSV fragments.
*/
struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions {
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions __pyx_base;
  arrow::dataset::CsvFragmentScanOptions *csv_options;
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *_read_options_py;
};


/* "pyarrow/_dataset.pyx":2376
 * 
 * 
 * cdef class CsvFileWriteOptions(FileWriteOptions):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCsvFileWriteOptions* csv_options
*/
struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions {
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions __pyx_base;
  arrow::dataset::CsvFileWriteOptions *csv_options;
  PyObject *_properties;
};


/* "pyarrow/_dataset.pyx":2398
 * 
 * 
 * cdef class JsonFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 *     """
 *     FileFormat for JSON files.
*/
struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat {
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat __pyx_base;
  arrow::dataset::JsonFileFormat *json_format;
};


/* "pyarrow/_dataset.pyx":2471
 * 
 * 
 * cdef class JsonFragmentScanOptions(FragmentScanOptions):             # <<<<<<<<<<<<<<
 *     """
 *     Scan-specific options for JSON fragments.
*/
struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions {
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions __pyx_base;
  arrow::dataset::JsonFragmentScanOptions *json_options;
};


/* "pyarrow/_dataset.pyx":2680
 * 
 * 
 * cdef class KeyValuePartitioning(Partitioning):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning {
  struct __pyx_obj_7pyarrow_8_dataset_Partitioning __pyx_base;
  arrow::dataset::KeyValuePartitioning *keyvalue_partitioning;
};


/* "pyarrow/_dataset.pyx":2730
 * 
 * 
 * cdef class DirectoryPartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning based on a specified Schema.
*/
struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning {
  struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
  arrow::dataset::DirectoryPartitioning *directory_partitioning;
};


/* "pyarrow/_dataset.pyx":2858
 * 
 * 
 * cdef class HivePartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning for "/$key=$value/" nested directories as found in
*/
struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning {
  struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
  arrow::dataset::HivePartitioning *hive_partitioning;
};


/* "pyarrow/_dataset.pyx":3009
 * 
 * 
 * cdef class FilenamePartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning based on a specified Schema.
*/
struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning {
  struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
  arrow::dataset::FilenamePartitioning *filename_partitioning;
};


/* "pyarrow/_dataset.pyx":3229
 * 
 * 
 * cdef class FileSystemFactoryOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     Influences the discovery of filesystem paths.
*/
struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_vtab;
  arrow::dataset::FileSystemFactoryOptions options;
};


/* "pyarrow/_dataset.pyx":3350
 * 
 * 
 * cdef class FileSystemDatasetFactory(DatasetFactory):             # <<<<<<<<<<<<<<
 *     """
 *     Create a DatasetFactory from a list of paths with schema inspection.
*/
struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory __pyx_base;
  arrow::dataset::FileSystemDatasetFactory *filesystem_factory;
};


/* "pyarrow/_dataset.pyx":3425
 * 
 * 
 * cdef class UnionDatasetFactory(DatasetFactory):             # <<<<<<<<<<<<<<
 *     """
 *     Provides a way to inspect/discover a Dataset's expected schema before
*/
struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory __pyx_base;
  arrow::dataset::UnionDatasetFactory *union_factory;
};


/* "pyarrow/_dataset.pyx":3451
 * 
 * 
 * cdef class RecordBatchIterator(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An iterator over a sequence of record batches."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_RecordBatchIterator *__pyx_vtab;
  PyObject *iterator_owner;
  arrow::py::SharedPtrNoGIL<arrow::RecordBatchIterator>  iterator;
};


/* "pyarrow/_dataset.pyx":3500
 * 
 * 
 * cdef class TaggedRecordBatchIterator(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An iterator over a sequence of record batches with fragments."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_vtab;
  PyObject *iterator_owner;
  arrow::py::SharedPtrNoGIL<arrow::dataset::TaggedRecordBatchIterator>  iterator;
};


/* "pyarrow/_dataset.pyx":4180
 * 
 * 
 * cdef class _ScanNodeOptions(ExecNodeOptions):             # <<<<<<<<<<<<<<
 * 
 *     def _set_options(self, Dataset dataset, dict scan_options):
*/
struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions {
  struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions __pyx_base;
};


/* "pyarrow/_dataset.pyx":256
 *         return self._get_fragments(filter)
 * 
 *     def _get_fragments(self, Expression filter):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExpression c_filter
*/
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments {
  PyObject_HEAD
  arrow::compute::Expression __pyx_v_c_filter;
  arrow::dataset::FragmentIterator __pyx_v_c_fragments;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter;
  arrow::Result<std::shared_ptr<arrow::dataset::Fragment> >  __pyx_v_maybe_fragment;
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self;
   arrow::Iterator<std::shared_ptr<arrow::dataset::Fragment> > ::RangeIterator __pyx_t_0;
};


/* "pyarrow/_dataset.pyx":3933
 *         record_batches : iterator of RecordBatch
 *         """
 *         def _iterator(batch_iter):             # <<<<<<<<<<<<<<
 *             for batch in batch_iter:
 *                 yield batch.record_batch
*/
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator {
  PyObject_HEAD
  PyObject *__pyx_v_batch;
  PyObject *__pyx_v_batch_iter;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};



/* "pyarrow/lib.pxd":65
 * 
 * 
 * cdef class MemoryPool(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
*/

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/lib.pxd":78
 * 
 * 
 * cdef class DataType(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
*/

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 *(*field)(struct __pyx_obj_7pyarrow_3lib_DataType *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtabptr_7pyarrow_3lib_DataType;


/* "pyarrow/lib.pxd":88
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListType* list_type
*/

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


/* "pyarrow/lib.pxd":93
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListType* list_type
*/

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


/* "pyarrow/lib.pxd":98
 * 
 * 
 * cdef class ListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListViewType* list_view_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType *__pyx_vtabptr_7pyarrow_3lib_ListViewType;


/* "pyarrow/lib.pxd":103
 * 
 * 
 * cdef class LargeListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListViewType* list_view_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType *__pyx_vtabptr_7pyarrow_3lib_LargeListViewType;


/* "pyarrow/lib.pxd":108
 * 
 * 
 * cdef class MapType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CMapType* map_type
*/

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


/* "pyarrow/lib.pxd":113
 * 
 * 
 * cdef class FixedSizeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeListType* list_type
*/

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


/* "pyarrow/lib.pxd":118
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CStructType* struct_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StructType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
  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/lib.pxd":133
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDictionaryType* dict_type
*/

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


/* "pyarrow/lib.pxd":138
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTimestampType* ts_type
*/

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


/* "pyarrow/lib.pxd":143
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime32Type* time_type
*/

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


/* "pyarrow/lib.pxd":148
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime64Type* time_type
*/

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


/* "pyarrow/lib.pxd":153
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDurationType* duration_type
*/

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


/* "pyarrow/lib.pxd":158
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeBinaryType* fixed_size_binary_type
*/

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


/* "pyarrow/lib.pxd":163
 * 
 * 
 * cdef class Decimal32Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal32Type* decimal32_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type *__pyx_vtabptr_7pyarrow_3lib_Decimal32Type;


/* "pyarrow/lib.pxd":168
 * 
 * 
 * cdef class Decimal64Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal64Type* decimal64_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type *__pyx_vtabptr_7pyarrow_3lib_Decimal64Type;


/* "pyarrow/lib.pxd":173
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal128Type* decimal128_type
*/

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


/* "pyarrow/lib.pxd":178
 * 
 * 
 * cdef class Decimal256Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal256Type* decimal256_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type *__pyx_vtabptr_7pyarrow_3lib_Decimal256Type;


/* "pyarrow/lib.pxd":183
 * 
 * 
 * cdef class RunEndEncodedType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CRunEndEncodedType* run_end_encoded_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType *__pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType;


/* "pyarrow/lib.pxd":188
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CExtensionType* ext_type
*/

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


/* "pyarrow/lib.pxd":193
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CPyExtensionType* cpy_ext_type
*/

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


/* "pyarrow/lib.pxd":198
 * 
 * 
 * cdef class FixedShapeTensorType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedShapeTensorType* tensor_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType *__pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType;


/* "pyarrow/lib.pxd":202
 *         const CFixedShapeTensorType* tensor_ext_type
 * 
 * cdef class Bool8Type(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CBool8Type* bool8_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type *__pyx_vtabptr_7pyarrow_3lib_Bool8Type;


/* "pyarrow/lib.pxd":206
 *         const CBool8Type* bool8_ext_type
 * 
 * cdef class OpaqueType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const COpaqueType* opaque_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType *__pyx_vtabptr_7pyarrow_3lib_OpaqueType;


/* "pyarrow/lib.pxd":210
 *         const COpaqueType* opaque_ext_type
 * 
 * cdef class UuidType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CUuidType* uuid_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UuidType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UuidType *__pyx_vtabptr_7pyarrow_3lib_UuidType;


/* "pyarrow/lib.pxd":214
 *         const CUuidType* uuid_ext_type
 * 
 * cdef class JsonType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CJsonType* json_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_JsonType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_JsonType *__pyx_vtabptr_7pyarrow_3lib_JsonType;


/* "pyarrow/lib.pxd":225
 * 
 * 
 * cdef class KeyValueMetadata(_Metadata):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[const CKeyValueMetadata] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata *, std::shared_ptr< arrow::KeyValueMetadata const >  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::KeyValueMetadata const >  const &);
  std::shared_ptr< arrow::KeyValueMetadata const >  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata *__pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata;


/* "pyarrow/lib.pxd":237
 * 
 * 
 * cdef class Field(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
*/

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/lib.pxd":248
 * 
 * 
 * cdef class Schema(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
*/

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/lib.pxd":257
 * 
 * 
 * cdef class Scalar(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Scalar {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Scalar *, std::shared_ptr< arrow::Scalar>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::Scalar>  const &);
  std::shared_ptr< arrow::Scalar>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_Scalar *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Scalar *__pyx_vtabptr_7pyarrow_3lib_Scalar;


/* "pyarrow/lib.pxd":269
 * 
 * 
 * cdef class ArrayStatistics(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArrayStatistics] sp_statistics
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics *, std::shared_ptr< arrow::ArrayStatistics>  const &);
  PyObject *(*_get_value)(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics *, std::optional< std::variant<bool, int64_t, uint64_t, double, std::string>>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics *__pyx_vtabptr_7pyarrow_3lib_ArrayStatistics;


/* "pyarrow/lib.pxd":281
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
*/

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 *);
  void (*_assert_cpu)(struct __pyx_obj_7pyarrow_3lib_Array *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtabptr_7pyarrow_3lib_Array;


/* "pyarrow/lib.pxd":297
 * 
 * 
 * cdef class Tensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_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/lib.pxd":310
 * 
 * 
 * cdef class SparseCSRMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSRMatrix] sp_sparse_tensor
*/

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


/* "pyarrow/lib.pxd":321
 * 
 * 
 * cdef class SparseCSCMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSCMatrix] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix *, std::shared_ptr< arrow::SparseCSCMatrix>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix *__pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix;


/* "pyarrow/lib.pxd":332
 * 
 * 
 * cdef class SparseCOOTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCOOTensor] sp_sparse_tensor
*/

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


/* "pyarrow/lib.pxd":343
 * 
 * 
 * cdef class SparseCSFTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSFTensor] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor *, std::shared_ptr< arrow::SparseCSFTensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor *__pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor;


/* "pyarrow/lib.pxd":354
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":358
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":362
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":366
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":370
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":374
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":378
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":382
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":386
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":390
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":394
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":398
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":402
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":406
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":410
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":414
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":418
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":422
 * 
 * 
 * cdef class Decimal32Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array *__pyx_vtabptr_7pyarrow_3lib_Decimal32Array;


/* "pyarrow/lib.pxd":426
 * 
 * 
 * cdef class Decimal64Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array *__pyx_vtabptr_7pyarrow_3lib_Decimal64Array;


/* "pyarrow/lib.pxd":430
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":434
 * 
 * 
 * cdef class Decimal256Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array *__pyx_vtabptr_7pyarrow_3lib_Decimal256Array;


/* "pyarrow/lib.pxd":438
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":442
 * 
 * 
 * cdef class BaseListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray *__pyx_vtabptr_7pyarrow_3lib_BaseListArray;


/* "pyarrow/lib.pxd":446
 * 
 * 
 * cdef class ListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":450
 * 
 * 
 * cdef class LargeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":454
 * 
 * 
 * cdef class ListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray *__pyx_vtabptr_7pyarrow_3lib_ListViewArray;


/* "pyarrow/lib.pxd":458
 * 
 * 
 * cdef class LargeListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray *__pyx_vtabptr_7pyarrow_3lib_LargeListViewArray;


/* "pyarrow/lib.pxd":462
 * 
 * 
 * cdef class MapArray(ListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":466
 * 
 * 
 * cdef class FixedSizeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":470
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":474
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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

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


/* "pyarrow/lib.pxd":482
 * 
 * 
 * cdef class StringViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray *__pyx_vtabptr_7pyarrow_3lib_StringViewArray;


/* "pyarrow/lib.pxd":486
 * 
 * 
 * cdef class BinaryViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray *__pyx_vtabptr_7pyarrow_3lib_BinaryViewArray;


/* "pyarrow/lib.pxd":490
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _indices, _dictionary
*/

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/lib.pxd":495
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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


/* "pyarrow/lib.pxd":499
 * 
 * 
 * cdef class MonthDayNanoIntervalArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray *__pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray;


/* "pyarrow/lib.pxd":507
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
*/

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/lib.pxd":522
 * 
 * 
 * cdef class _Tabular(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef void _assert_cpu(self) except *
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib__Tabular {
  void (*_assert_cpu)(struct __pyx_obj_7pyarrow_3lib__Tabular *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib__Tabular *__pyx_vtabptr_7pyarrow_3lib__Tabular;


/* "pyarrow/lib.pxd":526
 * 
 * 
 * cdef class Table(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Table {
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular __pyx_base;
  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/lib.pxd":536
 * 
 * 
 * cdef class RecordBatch(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatch] sp_batch
*/

struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch {
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular __pyx_base;
  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/lib.pxd":545
 * 
 * 
 * cdef class Device(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDevice] device
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Device {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Device *, std::shared_ptr< arrow::Device>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::Device>  const &);
  std::shared_ptr< arrow::Device>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_Device *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Device *__pyx_vtabptr_7pyarrow_3lib_Device;


/* "pyarrow/lib.pxd":557
 * 
 * 
 * cdef class MemoryManager(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CMemoryManager] memory_manager
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_MemoryManager *, std::shared_ptr< arrow::MemoryManager>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::MemoryManager>  const &);
  std::shared_ptr< arrow::MemoryManager>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_MemoryManager *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager *__pyx_vtabptr_7pyarrow_3lib_MemoryManager;


/* "pyarrow/lib.pxd":569
 * 
 * 
 * cdef class Buffer(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
*/

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

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


/* "pyarrow/lib.pxd":584
 * 
 * 
 * cdef class NativeFile(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] input_stream
*/

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/lib.pxd":608
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":612
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":616
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":620
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

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/lib.pxd":634
 * 
 * 
 * cdef class CacheOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCacheOptions wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_CacheOptions *, arrow::io::CacheOptions);
  arrow::io::CacheOptions (*unwrap)(struct __pyx_obj_7pyarrow_3lib_CacheOptions *);
  PyObject *(*wrap)(arrow::io::CacheOptions const );
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions *__pyx_vtabptr_7pyarrow_3lib_CacheOptions;


/* "pyarrow/lib.pxd":646
 * 
 * 
 * cdef class Codec(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CCodec] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Codec {
   arrow::util::Codec *(*unwrap)(struct __pyx_obj_7pyarrow_3lib_Codec *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Codec *__pyx_vtabptr_7pyarrow_3lib_Codec;


/* "pyarrow/lib.pxd":654
 * 
 * # This class is only used internally for now
 * cdef class StopToken:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStopToken stop_token
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StopToken {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_StopToken *, arrow::StopToken);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StopToken *__pyx_vtabptr_7pyarrow_3lib_StopToken;


/* "pyarrow/_fs.pxd":33
 * 
 * 
 * cdef class FileInfo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CFileInfo info
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo {
  PyObject *(*wrap)(arrow::fs::FileInfo);
  arrow::fs::FileInfo (*unwrap)(struct __pyx_obj_7pyarrow_3_fs_FileInfo *);
  arrow::fs::FileInfo (*unwrap_safe)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo *__pyx_vtabptr_7pyarrow_3_fs_FileInfo;


/* "pyarrow/_fs.pxd":46
 * 
 * 
 * cdef class FileSelector(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CFileSelector selector
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_FileSelector {
  struct __pyx_obj_7pyarrow_3_fs_FileSelector *(*wrap)(arrow::fs::FileSelector);
  arrow::fs::FileSelector (*unwrap)(struct __pyx_obj_7pyarrow_3_fs_FileSelector *);
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_FileSelector *__pyx_vtabptr_7pyarrow_3_fs_FileSelector;


/* "pyarrow/_fs.pxd":56
 * 
 * 
 * cdef class FileSystem(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CFileSystem] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_3_fs_FileSystem *, std::shared_ptr<arrow::fs::FileSystem>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::fs::FileSystem>  const &);
  std::shared_ptr<arrow::fs::FileSystem>  (*unwrap)(struct __pyx_obj_7pyarrow_3_fs_FileSystem *);
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *__pyx_vtabptr_7pyarrow_3_fs_FileSystem;


/* "pyarrow/_fs.pxd":69
 * 
 * 
 * cdef class LocalFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef init(self, const shared_ptr[CFileSystem]& wrapped)
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_LocalFileSystem {
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_LocalFileSystem *__pyx_vtabptr_7pyarrow_3_fs_LocalFileSystem;


/* "pyarrow/_fs.pxd":73
 * 
 * 
 * cdef class SubTreeFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CSubTreeFileSystem* subtreefs
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_SubTreeFileSystem {
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_SubTreeFileSystem *__pyx_vtabptr_7pyarrow_3_fs_SubTreeFileSystem;


/* "pyarrow/_fs.pxd":80
 * 
 * 
 * cdef class _MockFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMockFileSystem* mockfs
*/

struct __pyx_vtabstruct_7pyarrow_3_fs__MockFileSystem {
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3_fs__MockFileSystem *__pyx_vtabptr_7pyarrow_3_fs__MockFileSystem;


/* "pyarrow/_fs.pxd":87
 * 
 * 
 * cdef class PyFileSystem(FileSystem):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CPyFileSystem* pyfs
*/

struct __pyx_vtabstruct_7pyarrow_3_fs_PyFileSystem {
  struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3_fs_PyFileSystem *__pyx_vtabptr_7pyarrow_3_fs_PyFileSystem;


/* "pyarrow/_acero.pxd":26
 * 
 * 
 * cdef class ExecNodeOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CExecNodeOptions] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions {
  void (*init)(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions *, std::shared_ptr<arrow::acero::ExecNodeOptions>  const &);
  std::shared_ptr<arrow::acero::ExecNodeOptions>  (*unwrap)(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions *);
};
static struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions *__pyx_vtabptr_7pyarrow_6_acero_ExecNodeOptions;


/* "pyarrow/_acero.pxd":34
 * 
 * 
 * cdef class Declaration(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_6_acero_Declaration {
  void (*init)(struct __pyx_obj_7pyarrow_6_acero_Declaration *, arrow::acero::Declaration const &);
  PyObject *(*wrap)(arrow::acero::Declaration const &);
  arrow::acero::Declaration (*unwrap)(struct __pyx_obj_7pyarrow_6_acero_Declaration *);
};
static struct __pyx_vtabstruct_7pyarrow_6_acero_Declaration *__pyx_vtabptr_7pyarrow_6_acero_Declaration;


/* "pyarrow/_compute.pxd":24
 * from pyarrow.includes.libarrow cimport *
 * 
 * cdef class UdfContext(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CUdfContext c_context
*/

struct __pyx_vtabstruct_7pyarrow_8_compute_UdfContext {
  void (*init)(struct __pyx_obj_7pyarrow_8_compute_UdfContext *,  arrow::py::UdfContext const &);
};
static struct __pyx_vtabstruct_7pyarrow_8_compute_UdfContext *__pyx_vtabptr_7pyarrow_8_compute_UdfContext;


/* "pyarrow/_compute.pxd":31
 * 
 * 
 * cdef class FunctionOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CFunctionOptions] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_8_compute_FunctionOptions {
   arrow::compute::FunctionOptions const *(*get_options)(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions *);
  void (*init)(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions *, std::shared_ptr< arrow::compute::FunctionOptions>  const &);
  std::shared_ptr< arrow::compute::FunctionOptions>  (*unwrap)(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions *);
};
static struct __pyx_vtabstruct_7pyarrow_8_compute_FunctionOptions *__pyx_vtabptr_7pyarrow_8_compute_FunctionOptions;


/* "pyarrow/_compute.pxd":41
 * 
 * 
 * cdef class _SortOptions(FunctionOptions):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_8_compute__SortOptions {
  struct __pyx_vtabstruct_7pyarrow_8_compute_FunctionOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_compute__SortOptions *__pyx_vtabptr_7pyarrow_8_compute__SortOptions;


/* "pyarrow/_compute.pxd":48
 * 
 * 
 * cdef class Expression(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_8_compute_Expression {
  void (*init)(struct __pyx_obj_7pyarrow_8_compute_Expression *, arrow::compute::Expression const &);
  PyObject *(*wrap)(arrow::compute::Expression const &);
  arrow::compute::Expression (*unwrap)(struct __pyx_obj_7pyarrow_8_compute_Expression *);
  struct __pyx_obj_7pyarrow_8_compute_Expression *(*_expr_or_scalar)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *__pyx_vtabptr_7pyarrow_8_compute_Expression;


/* "pyarrow/_csv.pxd":24
 * 
 * 
 * cdef class ConvertOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVConvertOptions] options
*/

struct __pyx_vtabstruct_7pyarrow_4_csv_ConvertOptions {
  struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *(*wrap)( arrow::csv::ConvertOptions);
};
static struct __pyx_vtabstruct_7pyarrow_4_csv_ConvertOptions *__pyx_vtabptr_7pyarrow_4_csv_ConvertOptions;


/* "pyarrow/_csv.pxd":32
 * 
 * 
 * cdef class ParseOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVParseOptions] options
*/

struct __pyx_vtabstruct_7pyarrow_4_csv_ParseOptions {
  struct __pyx_obj_7pyarrow_4_csv_ParseOptions *(*wrap)( arrow::csv::ParseOptions);
};
static struct __pyx_vtabstruct_7pyarrow_4_csv_ParseOptions *__pyx_vtabptr_7pyarrow_4_csv_ParseOptions;


/* "pyarrow/_csv.pxd":41
 * 
 * 
 * cdef class ReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVReadOptions] options
*/

struct __pyx_vtabstruct_7pyarrow_4_csv_ReadOptions {
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *(*wrap)( arrow::csv::ReadOptions);
};
static struct __pyx_vtabstruct_7pyarrow_4_csv_ReadOptions *__pyx_vtabptr_7pyarrow_4_csv_ReadOptions;


/* "pyarrow/_csv.pxd":50
 * 
 * 
 * cdef class WriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CCSVWriteOptions] options
*/

struct __pyx_vtabstruct_7pyarrow_4_csv_WriteOptions {
  struct __pyx_obj_7pyarrow_4_csv_WriteOptions *(*wrap)( arrow::csv::WriteOptions);
};
static struct __pyx_vtabstruct_7pyarrow_4_csv_WriteOptions *__pyx_vtabptr_7pyarrow_4_csv_WriteOptions;


/* "pyarrow/_json.pxd":24
 * 
 * 
 * cdef class ParseOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CJSONParseOptions options
*/

struct __pyx_vtabstruct_7pyarrow_5_json_ParseOptions {
  struct __pyx_obj_7pyarrow_5_json_ParseOptions *(*wrap)( arrow::json::ParseOptions);
};
static struct __pyx_vtabstruct_7pyarrow_5_json_ParseOptions *__pyx_vtabptr_7pyarrow_5_json_ParseOptions;


/* "pyarrow/_json.pxd":31
 *     cdef ParseOptions wrap(CJSONParseOptions options)
 * 
 * cdef class ReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CJSONReadOptions options
*/

struct __pyx_vtabstruct_7pyarrow_5_json_ReadOptions {
  struct __pyx_obj_7pyarrow_5_json_ReadOptions *(*wrap)( arrow::json::ReadOptions);
};
static struct __pyx_vtabstruct_7pyarrow_5_json_ReadOptions *__pyx_vtabptr_7pyarrow_5_json_ReadOptions;


/* "pyarrow/_dataset.pyx":3121
 * 
 * 
 * cdef class DatasetFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     DatasetFactory is used to create a Dataset, inspect the Schema
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *, std::shared_ptr<arrow::dataset::DatasetFactory>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::DatasetFactory>  const &);
  std::shared_ptr<arrow::dataset::DatasetFactory>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory *__pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_f_7pyarrow_8_dataset_14DatasetFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *);


/* "pyarrow/_dataset.pyx":162
 * 
 * 
 * cdef class Dataset(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     Collection of data fragments and potentially child datasets.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, std::shared_ptr<arrow::dataset::Dataset>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::Dataset>  const &);
  std::shared_ptr<arrow::dataset::Dataset>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *__pyx_vtabptr_7pyarrow_8_dataset_Dataset;


/* "pyarrow/_dataset.pyx":3585
 * 
 * 
 * cdef class Scanner(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A materialized scan operation with context and options bound.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_Scanner {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_Scanner *, std::shared_ptr<arrow::dataset::Scanner>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::Scanner>  const &);
  std::shared_ptr<arrow::dataset::Scanner>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_Scanner *);
  std::shared_ptr<arrow::dataset::ScanOptions>  (*_make_scan_options)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Scanner *__pyx_vtabptr_7pyarrow_8_dataset_Scanner;
static std::shared_ptr<arrow::dataset::Scanner>  __pyx_f_7pyarrow_8_dataset_7Scanner_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Scanner *);


/* "pyarrow/_dataset.pyx":2078
 * 
 * 
 * cdef class FragmentScanOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Scan options specific to a particular fragment and scan operation."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions *__pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions;


/* "pyarrow/_dataset.pyx":1293
 * 
 * 
 * cdef class FileFormat(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, std::shared_ptr<arrow::dataset::FileFormat>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::FileFormat>  const &);
  std::shared_ptr<arrow::dataset::FileFormat>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *);
  PyObject *(*_set_default_fragment_scan_options)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *);
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *(*_finish_write)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, PyObject *, PyObject *, arrow::dataset::FileWriter *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat *__pyx_vtabptr_7pyarrow_8_dataset_FileFormat;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileFormat>  __pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *);


/* "pyarrow/_dataset.pyx":1258
 * 
 * 
 * cdef class FileWriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::FileWriteOptions>  const &);
  std::shared_ptr<arrow::dataset::FileWriteOptions>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions *__pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *);


/* "pyarrow/_dataset.pyx":1434
 * 
 * 
 * cdef class Fragment(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Fragment of data from a Dataset."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment {
  void (*init)(struct __pyx_obj_7pyarrow_8_dataset_Fragment *, std::shared_ptr<arrow::dataset::Fragment>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::Fragment>  const &);
  std::shared_ptr<arrow::dataset::Fragment>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_Fragment *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment *__pyx_vtabptr_7pyarrow_8_dataset_Fragment;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::Fragment>  __pyx_f_7pyarrow_8_dataset_8Fragment_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Fragment *);


/* "pyarrow/_dataset.pyx":1975
 * 
 * 
 * cdef class FileFragment(Fragment):             # <<<<<<<<<<<<<<
 *     """A Fragment representing a data file."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFragment {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFragment *__pyx_vtabptr_7pyarrow_8_dataset_FileFragment;


/* "pyarrow/_dataset.pyx":2536
 * 
 * 
 * cdef class Partitioning(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::Partitioning>  const &);
  std::shared_ptr<arrow::dataset::Partitioning>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning *__pyx_vtabptr_7pyarrow_8_dataset_Partitioning;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::Partitioning>  __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *);


/* "pyarrow/_dataset.pyx":2630
 * 
 * 
 * cdef class PartitioningFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_PartitioningFactory {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *, std::shared_ptr<arrow::dataset::PartitioningFactory>  const &);
  PyObject *(*wrap)(std::shared_ptr<arrow::dataset::PartitioningFactory>  const &, PyObject *, PyObject *);
  std::shared_ptr<arrow::dataset::PartitioningFactory>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_PartitioningFactory *__pyx_vtabptr_7pyarrow_8_dataset_PartitioningFactory;
static CYTHON_INLINE std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *);


/* "pyarrow/_dataset.pyx":994
 * 
 * 
 * cdef class InMemoryDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset wrapping in-memory data.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_InMemoryDataset {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_InMemoryDataset *__pyx_vtabptr_7pyarrow_8_dataset_InMemoryDataset;


/* "pyarrow/_dataset.pyx":1055
 * 
 * 
 * cdef class UnionDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset wrapping child datasets.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDataset {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDataset *__pyx_vtabptr_7pyarrow_8_dataset_UnionDataset;


/* "pyarrow/_dataset.pyx":1098
 * 
 * 
 * cdef class FileSystemDataset(Dataset):             # <<<<<<<<<<<<<<
 *     """
 *     A Dataset of file fragments.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDataset {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDataset *__pyx_vtabptr_7pyarrow_8_dataset_FileSystemDataset;


/* "pyarrow/_dataset.pyx":2119
 * 
 * 
 * cdef class IpcFileWriteOptions(FileWriteOptions):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcFileWriteOptions* ipc_options
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileWriteOptions {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_vtabptr_7pyarrow_8_dataset_IpcFileWriteOptions;


/* "pyarrow/_dataset.pyx":2142
 * 
 * 
 * cdef class IpcFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileFormat {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileFormat *__pyx_vtabptr_7pyarrow_8_dataset_IpcFileFormat;


/* "pyarrow/_dataset.pyx":2182
 * 
 * 
 * cdef class FeatherFileFormat(IpcFileFormat):             # <<<<<<<<<<<<<<
 * 
 *     @property
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FeatherFileFormat {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileFormat __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FeatherFileFormat *__pyx_vtabptr_7pyarrow_8_dataset_FeatherFileFormat;


/* "pyarrow/_dataset.pyx":2189
 * 
 * 
 * cdef class CsvFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 *     """
 *     FileFormat for CSV files.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileFormat {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileFormat *__pyx_vtabptr_7pyarrow_8_dataset_CsvFileFormat;


/* "pyarrow/_dataset.pyx":2298
 * 
 * 
 * cdef class CsvFragmentScanOptions(FragmentScanOptions):             # <<<<<<<<<<<<<<
 *     """
 *     Scan-specific options for CSV fragments.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFragmentScanOptions {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_vtabptr_7pyarrow_8_dataset_CsvFragmentScanOptions;


/* "pyarrow/_dataset.pyx":2376
 * 
 * 
 * cdef class CsvFileWriteOptions(FileWriteOptions):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCsvFileWriteOptions* csv_options
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileWriteOptions {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_vtabptr_7pyarrow_8_dataset_CsvFileWriteOptions;


/* "pyarrow/_dataset.pyx":2398
 * 
 * 
 * cdef class JsonFileFormat(FileFormat):             # <<<<<<<<<<<<<<
 *     """
 *     FileFormat for JSON files.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFileFormat {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFileFormat *__pyx_vtabptr_7pyarrow_8_dataset_JsonFileFormat;


/* "pyarrow/_dataset.pyx":2471
 * 
 * 
 * cdef class JsonFragmentScanOptions(FragmentScanOptions):             # <<<<<<<<<<<<<<
 *     """
 *     Scan-specific options for JSON fragments.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFragmentScanOptions {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_vtabptr_7pyarrow_8_dataset_JsonFragmentScanOptions;


/* "pyarrow/_dataset.pyx":2680
 * 
 * 
 * cdef class KeyValuePartitioning(Partitioning):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning;


/* "pyarrow/_dataset.pyx":2730
 * 
 * 
 * cdef class DirectoryPartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning based on a specified Schema.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_DirectoryPartitioning {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_DirectoryPartitioning *__pyx_vtabptr_7pyarrow_8_dataset_DirectoryPartitioning;


/* "pyarrow/_dataset.pyx":2858
 * 
 * 
 * cdef class HivePartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning for "/$key=$value/" nested directories as found in
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_HivePartitioning {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_HivePartitioning *__pyx_vtabptr_7pyarrow_8_dataset_HivePartitioning;


/* "pyarrow/_dataset.pyx":3009
 * 
 * 
 * cdef class FilenamePartitioning(KeyValuePartitioning):             # <<<<<<<<<<<<<<
 *     """
 *     A Partitioning based on a specified Schema.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FilenamePartitioning {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FilenamePartitioning *__pyx_vtabptr_7pyarrow_8_dataset_FilenamePartitioning;


/* "pyarrow/_dataset.pyx":3229
 * 
 * 
 * cdef class FileSystemFactoryOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     Influences the discovery of filesystem paths.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemFactoryOptions {
  arrow::dataset::FileSystemFactoryOptions (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_vtabptr_7pyarrow_8_dataset_FileSystemFactoryOptions;
static CYTHON_INLINE arrow::dataset::FileSystemFactoryOptions __pyx_f_7pyarrow_8_dataset_24FileSystemFactoryOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *);


/* "pyarrow/_dataset.pyx":3350
 * 
 * 
 * cdef class FileSystemDatasetFactory(DatasetFactory):             # <<<<<<<<<<<<<<
 *     """
 *     Create a DatasetFactory from a list of paths with schema inspection.
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDatasetFactory {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_vtabptr_7pyarrow_8_dataset_FileSystemDatasetFactory;


/* "pyarrow/_dataset.pyx":3425
 * 
 * 
 * cdef class UnionDatasetFactory(DatasetFactory):             # <<<<<<<<<<<<<<
 *     """
 *     Provides a way to inspect/discover a Dataset's expected schema before
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDatasetFactory {
  struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_vtabptr_7pyarrow_8_dataset_UnionDatasetFactory;


/* "pyarrow/_dataset.pyx":3451
 * 
 * 
 * cdef class RecordBatchIterator(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An iterator over a sequence of record batches."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_RecordBatchIterator {
  PyObject *(*wrap)(PyObject *, arrow::RecordBatchIterator);
  std::shared_ptr<arrow::RecordBatchIterator>  (*unwrap)(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_RecordBatchIterator *__pyx_vtabptr_7pyarrow_8_dataset_RecordBatchIterator;
static CYTHON_INLINE std::shared_ptr<arrow::RecordBatchIterator>  __pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_unwrap(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *);


/* "pyarrow/_dataset.pyx":3500
 * 
 * 
 * cdef class TaggedRecordBatchIterator(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An iterator over a sequence of record batches with fragments."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset_TaggedRecordBatchIterator {
  PyObject *(*wrap)(PyObject *, arrow::dataset::TaggedRecordBatchIterator);
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_vtabptr_7pyarrow_8_dataset_TaggedRecordBatchIterator;


/* "pyarrow/_dataset.pyx":4180
 * 
 * 
 * cdef class _ScanNodeOptions(ExecNodeOptions):             # <<<<<<<<<<<<<<
 * 
 *     def _set_options(self, Dataset dataset, dict scan_options):
*/

struct __pyx_vtabstruct_7pyarrow_8_dataset__ScanNodeOptions {
  struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_8_dataset__ScanNodeOptions *__pyx_vtabptr_7pyarrow_8_dataset__ScanNodeOptions;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, 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;
  #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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #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); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #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_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#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)

/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
#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

/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
#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 && PY_VERSION_HEX < 0x030C00A6
#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

/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
#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

/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

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

/* TupleAndListFromArray.proto (used by fastcall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* PyImportError_Check.proto */
#define __Pyx_PyExc_ImportError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ImportError)

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#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_XNewRef(__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

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  do {\
    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_mstate_global->__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);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
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

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* PyObjectCall.proto (used by PyObjectFastCall) */
#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

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

/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

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

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

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

/* GetTopmostException.proto (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
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

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

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

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

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

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

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

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

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

/* MoveIfSupported.proto */
#if CYTHON_USE_CPP_STD_MOVE
  #include <utility>
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
#else
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
#endif

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

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

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* PyObjectCall2Args.proto (used by CallUnboundCMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
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

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(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)   __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

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

/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

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

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

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

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

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

/* UnpackTuple2.proto (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int 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 (used by MergeKeywords) */
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);

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00a2
    return PyList_Extend(L, v);
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

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

/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#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

/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_NotImplementedError)

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

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

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto (used by FetchCommonType) */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

/* FetchSharedCythonModule.proto (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto (used by CythonFunction) */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (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 {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
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(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* tp_new.proto */
#define __Pyx_tp_new(type_obj, args) __Pyx_tp_new_kwargs(type_obj, args, NULL)
static CYTHON_INLINE PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs);

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API  ||  PY_VERSION_HEX >= 0x030C0000
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  #if __clang__ || __GNUC__
  __attribute__((no_sanitize("thread")))
  #endif
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

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

/* DictGetItem.proto */
#if !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

/* DefaultPlacementNew.proto */
#include <new>
template<typename T>
void __Pyx_default_placement_construct(T* x) {
    new (static_cast<void*>(x)) T();
}

/* CallNextTpDealloc.proto */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

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

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

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

/* GetApiDict.proto */
static PyObject *__Pyx_ApiExport_GetApiDict(void);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_4
#define __PYX_HAVE_RT_ImportType_proto_3_2_4
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_4 {
   __Pyx_ImportType_CheckSize_Error_3_2_4 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_4 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_4 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size);
#endif

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

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

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr_3_2_4(PyObject *module, const char *name, void **p, const char *sig);

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_2_4(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static 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);

/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

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

/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
#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 (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

/* LengthHint.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyObject_LengthHint(o, defaultval)  (defaultval)
#else
#define __Pyx_PyObject_LengthHint(o, defaultval)  PyObject_LengthHint(o, defaultval)
#endif

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

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

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

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

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

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

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

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

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, 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_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* IterNextPlain.proto (used by CoroutineBase) */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* ReturnWithStopIteration.proto (used by CoroutineBase) */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto (used by Generator) */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, 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 __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *gi_weakreflist;
#endif
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    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 __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
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);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
#endif
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_7Dataset_init(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_7Dataset_wrap(std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp); /* proto*/
static std::shared_ptr<arrow::dataset::Dataset>  __pyx_f_7pyarrow_8_dataset_7Dataset_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_15InMemoryDataset_init(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_12UnionDataset_init(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_17FileSystemDataset_init(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_16FileWriteOptions_wrap(std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_10FileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp); /* proto*/
static struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_f_7pyarrow_8_dataset_10FileFormat__finish_write(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_path, CYTHON_UNUSED PyObject *__pyx_v_base_dir, arrow::dataset::FileWriter *__pyx_v_file_writer); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileFormat>  __pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_10FileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_8Fragment_init(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_8Fragment_wrap(std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::Fragment>  __pyx_f_7pyarrow_8_dataset_8Fragment_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_12FileFragment_init(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self, std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_wrap(std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_19IpcFileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_13CsvFileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_13CsvFileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_22CsvFragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_19CsvFileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_14JsonFileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_14JsonFileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_23JsonFragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_12Partitioning_init(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_12Partitioning_wrap(std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::Partitioning>  __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_init(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::PartitioningFactory>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(std::shared_ptr<arrow::dataset::PartitioningFactory>  const &__pyx_v_sp, PyObject *__pyx_v_constructor, PyObject *__pyx_v_options); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_21DirectoryPartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_16HivePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_20FilenamePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_14DatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_14DatasetFactory_wrap(std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_f_7pyarrow_8_dataset_14DatasetFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self); /* proto*/
static CYTHON_INLINE arrow::dataset::FileSystemFactoryOptions __pyx_f_7pyarrow_8_dataset_24FileSystemFactoryOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_24FileSystemDatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_19UnionDatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_wrap(PyObject *__pyx_v_owner, arrow::RecordBatchIterator __pyx_v_iterator); /* proto*/
static CYTHON_INLINE std::shared_ptr<arrow::RecordBatchIterator>  __pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_unwrap(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_25TaggedRecordBatchIterator_wrap(PyObject *__pyx_v_owner, arrow::dataset::TaggedRecordBatchIterator __pyx_v_iterator); /* proto*/
static void __pyx_f_7pyarrow_8_dataset_7Scanner_init(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, std::shared_ptr<arrow::dataset::Scanner>  const &__pyx_v_sp); /* proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset_7Scanner_wrap(std::shared_ptr<arrow::dataset::Scanner>  const &__pyx_v_sp); /* proto*/
static std::shared_ptr<arrow::dataset::Scanner>  __pyx_f_7pyarrow_8_dataset_7Scanner_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto*/
static std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_f_7pyarrow_8_dataset_7Scanner__make_scan_options(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_py_scanoptions); /* proto*/

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

/* Module declarations from "libcpp" */

/* Module declarations from "libcpp.functional" */

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

/* Module declarations from "libcpp.optional" */

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

/* Module declarations from "libcpp.string_view" */

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

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

/* Module declarations from "cpython.bool" */

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

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

/* Module declarations from "cython" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "libc.stddef" */

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

/* Module declarations from "cpython.pyport" */

/* 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.set" */

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

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

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

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "datetime" */

/* Module declarations from "cpython.datetime" */

/* Module declarations from "pyarrow.includes.common" */

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

/* Module declarations from "pyarrow.includes.libarrow_acero" */

/* Module declarations from "pyarrow.includes.libarrow_python" */

/* Module declarations from "pyarrow.includes.libarrow_fs" */

/* Module declarations from "pyarrow.includes.libarrow_dataset" */

/* Module declarations from "cpython.slice" */

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

/* Module declarations from "pyarrow.lib" */
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 struct __pyx_obj_7pyarrow_3lib_NativeFile *(*__pyx_f_7pyarrow_3lib_get_native_file)(PyObject *, bool); /*proto*/
static std::shared_ptr<std::function<__pyx_t_7pyarrow_8includes_8libarrow_StreamWrapFunc> >  (*__pyx_f_7pyarrow_3lib_make_streamwrap_func)(PyObject *, PyObject *); /*proto*/
static  arrow::Field::MergeOptions (*__pyx_f_7pyarrow_3lib__parse_field_merge_options)(PyObject *); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer)(std::shared_ptr< arrow::Buffer>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer)(std::shared_ptr< arrow::ResizableBuffer>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type)(std::shared_ptr< arrow::DataType>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_field)(std::shared_ptr< arrow::Field>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema)(std::shared_ptr< arrow::Schema>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar)(std::shared_ptr< arrow::Scalar>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_array)(std::shared_ptr< arrow::Array>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array)(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor)(std::shared_ptr< arrow::SparseCOOTensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csc_matrix)(std::shared_ptr< arrow::SparseCSCMatrix>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csf_tensor)(std::shared_ptr< arrow::SparseCSFTensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix)(std::shared_ptr< arrow::SparseCSRMatrix>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor)(std::shared_ptr< arrow::Tensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch)(std::shared_ptr< arrow::RecordBatch>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_table)(std::shared_ptr< arrow::Table>  const &); /*proto*/
static std::shared_ptr< arrow::Buffer>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer)(PyObject *); /*proto*/
static std::shared_ptr< arrow::DataType>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Field>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Schema>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Scalar>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Array>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array)(PyObject *); /*proto*/
static std::shared_ptr< arrow::ChunkedArray>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_chunked_array)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCOOTensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSCMatrix>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csc_matrix)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSFTensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csf_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSRMatrix>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Tensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::RecordBatch>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Table>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table)(PyObject *); /*proto*/

/* Module declarations from "pyarrow._fs" */

/* Module declarations from "pyarrow._acero" */

/* Module declarations from "pyarrow._compute" */
static arrow::compute::Expression *__pyx_vp_7pyarrow_8_compute__true = 0;
#define __pyx_v_7pyarrow_8_compute__true (*__pyx_vp_7pyarrow_8_compute__true)
static arrow::compute::Expression (*__pyx_f_7pyarrow_8_compute__bind)(struct __pyx_obj_7pyarrow_8_compute_Expression *, struct __pyx_obj_7pyarrow_3lib_Schema *); /*proto*/

/* Module declarations from "pyarrow._csv" */

/* Module declarations from "pyarrow._json" */

/* Module declarations from "pyarrow._dataset" */
static struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_7pyarrow_8_dataset__true = 0;
static arrow::dataset::FileSource __pyx_f_7pyarrow_8_dataset__make_file_source(PyObject *, struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source *__pyx_optional_args); /*proto*/
static  arrow::dataset::SegmentEncoding __pyx_f_7pyarrow_8_dataset__get_segment_encoding(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset__wrap_segment_encoding( arrow::dataset::SegmentEncoding); /*proto*/
static std::vector<std::shared_ptr< arrow::Array> >  __pyx_f_7pyarrow_8_dataset__partitioning_dictionaries(struct __pyx_obj_7pyarrow_3lib_Schema *, PyObject *); /*proto*/
static std::vector<arrow::fs::FileInfo>  __pyx_f_7pyarrow_8_dataset_unwrap_finfos(PyObject *); /*proto*/
static void __pyx_f_7pyarrow_8_dataset__populate_builder(std::shared_ptr<arrow::dataset::ScannerBuilder>  const &, struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder *__pyx_optional_args); /*proto*/
static void __pyx_f_7pyarrow_8_dataset__filesystemdataset_write_visitor(PyObject *, arrow::dataset::FileWriter *); /*proto*/
static PyObject *__pyx_f_7pyarrow_8_dataset___pyx_unpickle_WrittenFile__set_state(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *, PyObject *); /*proto*/
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "pyarrow._dataset"
extern int __pyx_module_is_main_pyarrow___dataset;
int __pyx_module_is_main_pyarrow___dataset = 0;

/* Implementation of "pyarrow._dataset" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_zip;
/* #### Code section: string_decls ### */
static const char __pyx_k_metadata_path_size[] = "metadata, path, size";
static const char __pyx_k_Dataset_is_currently_unstable_AP[] = "Dataset is currently unstable. APIs subject to change without notice.";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_7pyarrow_8_dataset__get_orc_fileformat(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_2_get_parquet_classes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_4_get_parquet_symbol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_7Dataset___init__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_20partition_expression___get__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_2replace_schema(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_4get_fragments(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_6_get_fragments(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_9_scanner_options(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_11scanner(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_13to_batches(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_15to_table(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_17take(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_19head(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, int __pyx_v_num_rows, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_21count_rows(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_6schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_23filter(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_expression); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_25sort_by(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_sorting, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_27join(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_right_dataset, PyObject *__pyx_v_keys, PyObject *__pyx_v_right_keys, PyObject *__pyx_v_join_type, PyObject *__pyx_v_left_suffix, PyObject *__pyx_v_right_suffix, PyObject *__pyx_v_coalesce_keys, PyObject *__pyx_v_use_threads); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_29join_asof(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_right_dataset, PyObject *__pyx_v_on, PyObject *__pyx_v_by, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_right_on, PyObject *__pyx_v_right_by); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options___get__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_4__del__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_31__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_33__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_15InMemoryDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_12UnionDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_children); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12UnionDataset_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12UnionDataset_8children___get__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self, PyObject *__pyx_v_fragments, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, PyObject *__pyx_v_root_partition); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_10filesystem___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_12partitioning___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_4from_paths(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_paths, PyObject *__pyx_v_schema, PyObject *__pyx_v_format, PyObject *__pyx_v_filesystem, PyObject *__pyx_v_partitions, PyObject *__pyx_v_root_partition); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_5files___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_10FileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_2inspect(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_filesystem); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_4make_fragment(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_filesystem, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression, PyObject *__pyx_v_file_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_6make_write_options(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_15default_extname___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_8__eq__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_8Fragment___init__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_15physical_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_20partition_expression___get__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_2scanner(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_4to_batches(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_6to_table(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_8take(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_10head(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, int __pyx_v_num_rows, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_12count_rows(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment___repr__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_4open(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_4path___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_10filesystem___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_6buffer___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_9type_name___get__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_2__eq__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options___get__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_v_write_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_2equals(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_15default_extname___get__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname___get__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ParseOptions *__pyx_v_parse_options, PyObject *__pyx_v_default_fragment_scan_options, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ParseOptions *__pyx_v_parse_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_4equals(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_8__repr__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_4__del__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_WriteOptions *__pyx_v_write_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, PyObject *__pyx_v_default_fragment_scan_options, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_2equals(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_6__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options___get__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options___get__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_12Partitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_2__eq__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_4parse(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_6format(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_6schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19PartitioningFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_9type_name___get__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries___get__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_6_constructor_directory_partitioning_factory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_segment_encoding); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning_2discover(PyObject *__pyx_v_field_names, PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_max_partition_dictionary_size, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_8_constructor_hive_partitioning_factory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_16HivePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_null_fallback, PyObject *__pyx_v_segment_encoding); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16HivePartitioning_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16HivePartitioning_4discover(PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_max_partition_dictionary_size, PyObject *__pyx_v_null_fallback, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_10_constructor_filename_partitioning_factory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_segment_encoding); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning_2discover(PyObject *__pyx_v_field_names, PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_14DatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition___get__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition_2__set__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_expr); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_4inspect(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, PyObject *__pyx_v_promote_options, PyObject *__pyx_v_fragments); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_6finish(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_partition_base_dir, PyObject *__pyx_v_partitioning, PyObject *__pyx_v_exclude_invalid_files, PyObject *__pyx_v_selector_ignore_prefixes); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, PyObject *__pyx_v_paths_or_selector, struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format, struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, PyObject *__pyx_v_factories); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator___init__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_2__iter__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_4__next__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator___init__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_2__iter__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_4__next__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_7Scanner___init__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_2from_dataset(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_columns, PyObject *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_4from_fragment(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_fragment, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_6from_batches(PyObject *__pyx_v_source, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_14dataset_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_16projected_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_10to_batches__iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_batch_iter); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_8to_batches(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_10scan_batches(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_12to_table(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_14take(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_16head(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, int __pyx_v_num_rows); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_18count_rows(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_20to_reader(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_12get_partition_keys(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile___init__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_metadata, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path___get__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_4__del__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata___get__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_4__del__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size___get__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_14_filesystemdataset_write(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_data, PyObject *__pyx_v_base_dir, PyObject *__pyx_v_basename_template, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_partitioning, bool __pyx_v_preserve_order, struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_file_options, int __pyx_v_max_partitions, PyObject *__pyx_v_file_visitor, PyObject *__pyx_v_existing_data_behavior, int __pyx_v_max_open_files, int __pyx_v_max_rows_per_file, int __pyx_v_min_rows_per_group, int __pyx_v_max_rows_per_group, bool __pyx_v_create_dir); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions__set_options(struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_scan_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_15ScanNodeOptions___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_8_dataset_16__pyx_unpickle_WrittenFile(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_8_dataset_DatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Dataset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Scanner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileFormat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Fragment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileFragment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Partitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_PartitioningFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_WrittenFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_InMemoryDataset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_UnionDataset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemDataset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_IpcFileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_IpcFileFormat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FeatherFileFormat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFileFormat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_JsonFileFormat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_JsonFragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_DirectoryPartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_HivePartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FilenamePartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemFactoryOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemDatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_UnionDatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_RecordBatchIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset_TaggedRecordBatchIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset__ScanNodeOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct___get_fragments(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct_1__iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#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

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_date;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_time;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Weakrefable;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IpcWriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IpcReadOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Message;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryPool;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DataType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListViewType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListViewType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryMemo;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DurationType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal32Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal64Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal256Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RunEndEncodedType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseExtensionType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Bool8Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_OpaqueType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UuidType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_JsonType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Metadata;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_KeyValueMetadata;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Field;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Schema;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Scalar;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ArrayStatistics;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasConvertible;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCOOTensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSFTensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NumericArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IntegerArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal256Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ChunkedArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Tabular;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Table;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatch;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Device;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryManager;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Buffer;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ResizableBuffer;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NativeFile;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedInputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedOutputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedInputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedOutputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatchReader;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CacheOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Codec;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StopToken;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_FileInfo;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_FileSelector;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_FileSystem;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_LocalFileSystem;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs__MockFileSystem;
  PyTypeObject *__pyx_ptype_7pyarrow_3_fs_PyFileSystem;
  PyTypeObject *__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_6_acero_Declaration;
  PyTypeObject *__pyx_ptype_7pyarrow_8_compute_UdfContext;
  PyTypeObject *__pyx_ptype_7pyarrow_8_compute_FunctionOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_compute__SortOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_compute_Expression;
  PyTypeObject *__pyx_ptype_7pyarrow_4_csv_ConvertOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_4_csv_ParseOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_4_csv_ReadOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_4_csv_WriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_5_json_ParseOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_5_json_ReadOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_DatasetFactory;
  PyObject *__pyx_type_7pyarrow_8_dataset_Dataset;
  PyObject *__pyx_type_7pyarrow_8_dataset_Scanner;
  PyObject *__pyx_type_7pyarrow_8_dataset_FragmentScanOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileFormat;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileWriteOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_Fragment;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileFragment;
  PyObject *__pyx_type_7pyarrow_8_dataset_Partitioning;
  PyObject *__pyx_type_7pyarrow_8_dataset_PartitioningFactory;
  PyObject *__pyx_type_7pyarrow_8_dataset_WrittenFile;
  PyObject *__pyx_type_7pyarrow_8_dataset_InMemoryDataset;
  PyObject *__pyx_type_7pyarrow_8_dataset_UnionDataset;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileSystemDataset;
  PyObject *__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_IpcFileFormat;
  PyObject *__pyx_type_7pyarrow_8_dataset_FeatherFileFormat;
  PyObject *__pyx_type_7pyarrow_8_dataset_CsvFileFormat;
  PyObject *__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_JsonFileFormat;
  PyObject *__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning;
  PyObject *__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning;
  PyObject *__pyx_type_7pyarrow_8_dataset_HivePartitioning;
  PyObject *__pyx_type_7pyarrow_8_dataset_FilenamePartitioning;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory;
  PyObject *__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory;
  PyObject *__pyx_type_7pyarrow_8_dataset_RecordBatchIterator;
  PyObject *__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator;
  PyObject *__pyx_type_7pyarrow_8_dataset__ScanNodeOptions;
  PyObject *__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments;
  PyObject *__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_DatasetFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_Dataset;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_Scanner;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileFormat;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_Fragment;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileFragment;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_Partitioning;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_WrittenFile;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_UnionDataset;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_HivePartitioning;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments;
  PyTypeObject *__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  int __pyx_k__2;
  int __pyx_k__3;
  int __pyx_k__4;
  int __pyx_k__5;
  int __pyx_k__6;
  int __pyx_k__7;
  int __pyx_k__8;
  int __pyx_k__9;
  int __pyx_k__10;
  int __pyx_k__11;
  int __pyx_k__12;
  int __pyx_k__13;
  int __pyx_k__14;
  int __pyx_k__15;
  int __pyx_k__16;
  int __pyx_k__17;
  int __pyx_k__18;
  int __pyx_k__19;
  int __pyx_k__21;
  int __pyx_k__22;
  int __pyx_k__23;
  int __pyx_k__24;
  int __pyx_k__25;
  int __pyx_k__26;
  int __pyx_k__27;
  int __pyx_k__28;
  int __pyx_k__29;
  int __pyx_k__30;
  int __pyx_k__31;
  int __pyx_k__32;
  int __pyx_k__33;
  int __pyx_k__34;
  int __pyx_k__35;
  int __pyx_k__36;
  int __pyx_k__37;
  int __pyx_k__38;
  int __pyx_k__44;
  int __pyx_k__45;
  int __pyx_k__46;
  int __pyx_k__47;
  int __pyx_k__48;
  int __pyx_k__49;
  int __pyx_k__50;
  int __pyx_k__51;
  int __pyx_k__52;
  int __pyx_k__53;
  int __pyx_k__54;
  int __pyx_k__55;
  PyObject *__pyx_tuple[8];
  PyObject *__pyx_codeobj_tab[109];
  PyObject *__pyx_string_tab[595];
  PyObject *__pyx_number_tab[7];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct___get_fragments[8];
int __pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct___get_fragments;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct_1__iterator[8];
int __pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct_1__iterator;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* Generator.module_state_decls */
PyTypeObject *__pyx_GeneratorType;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_A_Source_node_which_yields_batc __pyx_string_tab[1]
#define __pyx_kp_u_A_combination_of_a_record_batch __pyx_string_tab[2]
#define __pyx_kp_u_Argument __pyx_string_tab[3]
#define __pyx_kp_u_Argument_root_partition_has_inco __pyx_string_tab[4]
#define __pyx_kp_u_Build_a_scan_operation_against __pyx_string_tab[5]
#define __pyx_kp_u_Cannot_set_fragment_scan_options __pyx_string_tab[6]
#define __pyx_kp_u_Cannot_specify_a_schema_when_pro __pyx_string_tab[7]
#define __pyx_kp_u_Cannot_specify_a_schema_when_pro_2 __pyx_string_tab[8]
#define __pyx_kp_u_Convert_a_filter_expression_int __pyx_string_tab[9]
#define __pyx_kp_u_CsvFileFormat_parse_options __pyx_string_tab[10]
#define __pyx_kp_u_Dataset_scanner_line_295 __pyx_string_tab[11]
#define __pyx_kp_u_Expected_a_RecordBatchReader_or __pyx_string_tab[12]
#define __pyx_kp_u_Expected_a_Table_RecordBatch_lis __pyx_string_tab[13]
#define __pyx_kp_u_Expected_a_list_of_tables_or_bat __pyx_string_tab[14]
#define __pyx_kp_u_Expected_a_list_or_a_dict_for_co __pyx_string_tab[15]
#define __pyx_kp_u_Expected_an_Expression_for_a_col __pyx_string_tab[16]
#define __pyx_kp_u_Fragment_count_must_be_a_non_neg __pyx_string_tab[17]
#define __pyx_kp_u_If_default_fragment_scan_options __pyx_string_tab[18]
#define __pyx_kp_u_If_default_fragment_scan_options_2 __pyx_string_tab[19]
#define __pyx_kp_u_Item_has_schema __pyx_string_tab[20]
#define __pyx_kp_u_JsonFileFormat __pyx_string_tab[21]
#define __pyx_kp_u_Must_pass_either_paths_or_a_File __pyx_string_tab[22]
#define __pyx_kp_u_Must_provide_schema_to_construct __pyx_string_tab[23]
#define __pyx_kp_u_Must_provide_schema_to_construct_2 __pyx_string_tab[24]
#define __pyx_kp_u_Neither_field_names_nor_schema_w __pyx_string_tab[25]
#define __pyx_kp_u_None __pyx_string_tab[26]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[27]
#define __pyx_kp_u_Only_one_BoundExpressions_with_a __pyx_string_tab[28]
#define __pyx_kp_u_Partitioning_format_line_2587 __pyx_string_tab[29]
#define __pyx_kp_u_Retrieving_fragments_of_a_filter __pyx_string_tab[30]
#define __pyx_kp_u_The_number_of_files_resulting_fr __pyx_string_tab[31]
#define __pyx_kp_u_Unknown_segment_encoding __pyx_string_tab[32]
#define __pyx_kp_u_Unknown_segment_encoding_2 __pyx_string_tab[33]
#define __pyx_kp_u_Writing_datasets_not_yet_impleme __pyx_string_tab[34]
#define __pyx_kp_u__20 __pyx_string_tab[35]
#define __pyx_kp_u__39 __pyx_string_tab[36]
#define __pyx_kp_u__40 __pyx_string_tab[37]
#define __pyx_kp_u__41 __pyx_string_tab[38]
#define __pyx_kp_u__42 __pyx_string_tab[39]
#define __pyx_kp_u__43 __pyx_string_tab[40]
#define __pyx_kp_u__56 __pyx_string_tab[41]
#define __pyx_kp_u_add_note __pyx_string_tab[42]
#define __pyx_kp_u_cannot_construct_a_FileSource_fr __pyx_string_tab[43]
#define __pyx_kp_u_cannot_construct_a_FileSource_fr_2 __pyx_string_tab[44]
#define __pyx_kp_u_default_fragment_scan_options_m __pyx_string_tab[45]
#define __pyx_kp_u_default_fragment_scan_options_m_2 __pyx_string_tab[46]
#define __pyx_kp_u_disable __pyx_string_tab[47]
#define __pyx_kp_u_enable __pyx_string_tab[48]
#define __pyx_kp_u_existing_data_behavior_must_be_o __pyx_string_tab[49]
#define __pyx_kp_u_gc __pyx_string_tab[50]
#define __pyx_kp_u_got __pyx_string_tab[51]
#define __pyx_kp_u_has_incorrect_type_expected __pyx_string_tab[52]
#define __pyx_kp_u_in_memory __pyx_string_tab[53]
#define __pyx_kp_u_instead __pyx_string_tab[54]
#define __pyx_kp_u_instead_2 __pyx_string_tab[55]
#define __pyx_kp_u_isenabled __pyx_string_tab[56]
#define __pyx_kp_u_left_outer __pyx_string_tab[57]
#define __pyx_kp_u_max_partition_dictionary_size_mu __pyx_string_tab[58]
#define __pyx_kp_u_on_2 __pyx_string_tab[59]
#define __pyx_kp_u_overwrite_or_ignore_or_delete_m __pyx_string_tab[60]
#define __pyx_kp_u_partition __pyx_string_tab[61]
#define __pyx_kp_u_path __pyx_string_tab[62]
#define __pyx_kp_u_pyarrow__dataset_pyx __pyx_string_tab[63]
#define __pyx_kp_u_pyarrow_dataset __pyx_string_tab[64]
#define __pyx_kp_u_self_c_options_self_csv_options __pyx_string_tab[65]
#define __pyx_kp_u_self_c_options_self_ipc_options __pyx_string_tab[66]
#define __pyx_kp_u_self_c_options_self_wrapped_cann __pyx_string_tab[67]
#define __pyx_kp_u_self_dataset_self_in_memory_data __pyx_string_tab[68]
#define __pyx_kp_u_self_dataset_self_wrapped_cannot __pyx_string_tab[69]
#define __pyx_kp_u_self_factory_self_filesystem_fac __pyx_string_tab[70]
#define __pyx_kp_u_self_factory_self_union_factory __pyx_string_tab[71]
#define __pyx_kp_u_self_factory_self_wrapped_cannot __pyx_string_tab[72]
#define __pyx_kp_u_self_format_self_wrapped_cannot __pyx_string_tab[73]
#define __pyx_kp_u_self_fragment_self_wrapped_canno __pyx_string_tab[74]
#define __pyx_kp_u_self_iterator_cannot_be_converte __pyx_string_tab[75]
#define __pyx_kp_u_self_options_cannot_be_converted __pyx_string_tab[76]
#define __pyx_kp_u_self_partitioning_self_wrapped_c __pyx_string_tab[77]
#define __pyx_kp_u_self_scanner_self_wrapped_cannot __pyx_string_tab[78]
#define __pyx_kp_u_self_wrapped_cannot_be_converted __pyx_string_tab[79]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[80]
#define __pyx_kp_u_type __pyx_string_tab[81]
#define __pyx_kp_u_utf_8 __pyx_string_tab[82]
#define __pyx_kp_u_which_does_not_match_expected_s __pyx_string_tab[83]
#define __pyx_n_u_Array __pyx_string_tab[84]
#define __pyx_n_u_ArrowTypeError __pyx_string_tab[85]
#define __pyx_n_u_BoundExpressions __pyx_string_tab[86]
#define __pyx_n_u_BufferReader __pyx_string_tab[87]
#define __pyx_n_u_CsvFileFormat __pyx_string_tab[88]
#define __pyx_n_u_CsvFileFormat___reduce __pyx_string_tab[89]
#define __pyx_n_u_CsvFileFormat_equals __pyx_string_tab[90]
#define __pyx_n_u_CsvFileFormat_make_write_options __pyx_string_tab[91]
#define __pyx_n_u_CsvFileWriteOptions __pyx_string_tab[92]
#define __pyx_n_u_CsvFileWriteOptions___reduce_cyt __pyx_string_tab[93]
#define __pyx_n_u_CsvFileWriteOptions___setstate_c __pyx_string_tab[94]
#define __pyx_n_u_CsvFragmentScanOptions __pyx_string_tab[95]
#define __pyx_n_u_CsvFragmentScanOptions___reduce __pyx_string_tab[96]
#define __pyx_n_u_CsvFragmentScanOptions_equals __pyx_string_tab[97]
#define __pyx_n_u_DEFAULT_BATCH_READAHEAD __pyx_string_tab[98]
#define __pyx_n_u_DEFAULT_BATCH_SIZE __pyx_string_tab[99]
#define __pyx_n_u_DEFAULT_FRAGMENT_READAHEAD __pyx_string_tab[100]
#define __pyx_n_u_Dataset __pyx_string_tab[101]
#define __pyx_n_u_DatasetFactory __pyx_string_tab[102]
#define __pyx_n_u_DatasetFactory___reduce_cython __pyx_string_tab[103]
#define __pyx_n_u_DatasetFactory___setstate_cython __pyx_string_tab[104]
#define __pyx_n_u_DatasetFactory_finish __pyx_string_tab[105]
#define __pyx_n_u_DatasetFactory_inspect __pyx_string_tab[106]
#define __pyx_n_u_DatasetFactory_inspect_schemas __pyx_string_tab[107]
#define __pyx_n_u_Dataset___reduce_cython __pyx_string_tab[108]
#define __pyx_n_u_Dataset___setstate_cython __pyx_string_tab[109]
#define __pyx_n_u_Dataset__get_fragments __pyx_string_tab[110]
#define __pyx_n_u_Dataset__scanner_options __pyx_string_tab[111]
#define __pyx_n_u_Dataset_count_rows __pyx_string_tab[112]
#define __pyx_n_u_Dataset_filter __pyx_string_tab[113]
#define __pyx_n_u_Dataset_get_fragments __pyx_string_tab[114]
#define __pyx_n_u_Dataset_head __pyx_string_tab[115]
#define __pyx_n_u_Dataset_join __pyx_string_tab[116]
#define __pyx_n_u_Dataset_join_asof __pyx_string_tab[117]
#define __pyx_n_u_Dataset_replace_schema __pyx_string_tab[118]
#define __pyx_n_u_Dataset_scanner __pyx_string_tab[119]
#define __pyx_n_u_Dataset_sort_by __pyx_string_tab[120]
#define __pyx_n_u_Dataset_take __pyx_string_tab[121]
#define __pyx_n_u_Dataset_to_batches __pyx_string_tab[122]
#define __pyx_n_u_Dataset_to_table __pyx_string_tab[123]
#define __pyx_n_u_DictionaryType __pyx_string_tab[124]
#define __pyx_n_u_DirectoryPartitioning __pyx_string_tab[125]
#define __pyx_n_u_DirectoryPartitioning_discover __pyx_string_tab[126]
#define __pyx_n_u_FeatherFileFormat __pyx_string_tab[127]
#define __pyx_n_u_FileFormat __pyx_string_tab[128]
#define __pyx_n_u_FileFormat___reduce_cython __pyx_string_tab[129]
#define __pyx_n_u_FileFormat___setstate_cython __pyx_string_tab[130]
#define __pyx_n_u_FileFormat_inspect __pyx_string_tab[131]
#define __pyx_n_u_FileFormat_make_fragment __pyx_string_tab[132]
#define __pyx_n_u_FileFormat_make_write_options __pyx_string_tab[133]
#define __pyx_n_u_FileFragment __pyx_string_tab[134]
#define __pyx_n_u_FileFragment___reduce __pyx_string_tab[135]
#define __pyx_n_u_FileFragment_open __pyx_string_tab[136]
#define __pyx_n_u_FileSystemDataset __pyx_string_tab[137]
#define __pyx_n_u_FileSystemDatasetFactory __pyx_string_tab[138]
#define __pyx_n_u_FileSystemDatasetFactory___reduc __pyx_string_tab[139]
#define __pyx_n_u_FileSystemDatasetFactory___setst __pyx_string_tab[140]
#define __pyx_n_u_FileSystemDataset___reduce __pyx_string_tab[141]
#define __pyx_n_u_FileSystemDataset_from_paths __pyx_string_tab[142]
#define __pyx_n_u_FileSystemFactoryOptions __pyx_string_tab[143]
#define __pyx_n_u_FileSystemFactoryOptions___reduc __pyx_string_tab[144]
#define __pyx_n_u_FileSystemFactoryOptions___setst __pyx_string_tab[145]
#define __pyx_n_u_FileWriteOptions __pyx_string_tab[146]
#define __pyx_n_u_FileWriteOptions___reduce_cython __pyx_string_tab[147]
#define __pyx_n_u_FileWriteOptions___setstate_cyth __pyx_string_tab[148]
#define __pyx_n_u_FilenamePartitioning __pyx_string_tab[149]
#define __pyx_n_u_FilenamePartitioning_discover __pyx_string_tab[150]
#define __pyx_n_u_Fragment __pyx_string_tab[151]
#define __pyx_n_u_FragmentScanOptions __pyx_string_tab[152]
#define __pyx_n_u_FragmentScanOptions___reduce_cyt __pyx_string_tab[153]
#define __pyx_n_u_FragmentScanOptions___setstate_c __pyx_string_tab[154]
#define __pyx_n_u_Fragment___reduce_cython __pyx_string_tab[155]
#define __pyx_n_u_Fragment___setstate_cython __pyx_string_tab[156]
#define __pyx_n_u_Fragment_count_rows __pyx_string_tab[157]
#define __pyx_n_u_Fragment_head __pyx_string_tab[158]
#define __pyx_n_u_Fragment_scanner __pyx_string_tab[159]
#define __pyx_n_u_Fragment_take __pyx_string_tab[160]
#define __pyx_n_u_Fragment_to_batches __pyx_string_tab[161]
#define __pyx_n_u_Fragment_to_table __pyx_string_tab[162]
#define __pyx_n_u_HIVE_DEFAULT_PARTITION __pyx_string_tab[163]
#define __pyx_n_u_HivePartitioning __pyx_string_tab[164]
#define __pyx_n_u_HivePartitioning___reduce __pyx_string_tab[165]
#define __pyx_n_u_HivePartitioning_discover __pyx_string_tab[166]
#define __pyx_n_u_InMemoryDataset __pyx_string_tab[167]
#define __pyx_n_u_InMemoryDataset___reduce_cython __pyx_string_tab[168]
#define __pyx_n_u_InMemoryDataset___setstate_cytho __pyx_string_tab[169]
#define __pyx_n_u_IpcFileFormat __pyx_string_tab[170]
#define __pyx_n_u_IpcFileFormat___reduce __pyx_string_tab[171]
#define __pyx_n_u_IpcFileFormat_equals __pyx_string_tab[172]
#define __pyx_n_u_IpcFileFormat_make_write_options __pyx_string_tab[173]
#define __pyx_n_u_IpcFileWriteOptions __pyx_string_tab[174]
#define __pyx_n_u_IpcFileWriteOptions___reduce_cyt __pyx_string_tab[175]
#define __pyx_n_u_IpcFileWriteOptions___setstate_c __pyx_string_tab[176]
#define __pyx_n_u_JsonFileFormat_2 __pyx_string_tab[177]
#define __pyx_n_u_JsonFileFormat___reduce __pyx_string_tab[178]
#define __pyx_n_u_JsonFileFormat_equals __pyx_string_tab[179]
#define __pyx_n_u_JsonFragmentScanOptions __pyx_string_tab[180]
#define __pyx_n_u_JsonFragmentScanOptions___reduce __pyx_string_tab[181]
#define __pyx_n_u_JsonFragmentScanOptions_equals __pyx_string_tab[182]
#define __pyx_n_u_KeyValuePartitioning __pyx_string_tab[183]
#define __pyx_n_u_KeyValuePartitioning___reduce __pyx_string_tab[184]
#define __pyx_n_u_OrcFileFormat __pyx_string_tab[185]
#define __pyx_n_u_ParquetFileFormat __pyx_string_tab[186]
#define __pyx_n_u_ParquetFileFragment __pyx_string_tab[187]
#define __pyx_n_u_ParquetFileWriteOptions __pyx_string_tab[188]
#define __pyx_n_u_ParquetFragmentScanOptions __pyx_string_tab[189]
#define __pyx_n_u_Partitioning __pyx_string_tab[190]
#define __pyx_n_u_PartitioningFactory __pyx_string_tab[191]
#define __pyx_n_u_PartitioningFactory___reduce __pyx_string_tab[192]
#define __pyx_n_u_Partitioning___reduce_cython __pyx_string_tab[193]
#define __pyx_n_u_Partitioning___setstate_cython __pyx_string_tab[194]
#define __pyx_n_u_Partitioning_format __pyx_string_tab[195]
#define __pyx_n_u_Partitioning_parse __pyx_string_tab[196]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[197]
#define __pyx_n_u_RecordBatch __pyx_string_tab[198]
#define __pyx_n_u_RecordBatchIterator __pyx_string_tab[199]
#define __pyx_n_u_RecordBatchIterator___reduce_cyt __pyx_string_tab[200]
#define __pyx_n_u_RecordBatchIterator___setstate_c __pyx_string_tab[201]
#define __pyx_n_u_RecordBatchReader __pyx_string_tab[202]
#define __pyx_n_u_ScanNodeOptions __pyx_string_tab[203]
#define __pyx_n_u_ScanNodeOptions_2 __pyx_string_tab[204]
#define __pyx_n_u_ScanNodeOptions___init __pyx_string_tab[205]
#define __pyx_n_u_ScanNodeOptions___reduce_cython __pyx_string_tab[206]
#define __pyx_n_u_ScanNodeOptions___setstate_cyth __pyx_string_tab[207]
#define __pyx_n_u_ScanNodeOptions__set_options __pyx_string_tab[208]
#define __pyx_n_u_Scanner __pyx_string_tab[209]
#define __pyx_n_u_Scanner___reduce_cython __pyx_string_tab[210]
#define __pyx_n_u_Scanner___setstate_cython __pyx_string_tab[211]
#define __pyx_n_u_Scanner_count_rows __pyx_string_tab[212]
#define __pyx_n_u_Scanner_from_batches __pyx_string_tab[213]
#define __pyx_n_u_Scanner_from_dataset __pyx_string_tab[214]
#define __pyx_n_u_Scanner_from_fragment __pyx_string_tab[215]
#define __pyx_n_u_Scanner_head __pyx_string_tab[216]
#define __pyx_n_u_Scanner_scan_batches __pyx_string_tab[217]
#define __pyx_n_u_Scanner_take __pyx_string_tab[218]
#define __pyx_n_u_Scanner_to_batches __pyx_string_tab[219]
#define __pyx_n_u_Scanner_to_reader __pyx_string_tab[220]
#define __pyx_n_u_Scanner_to_table __pyx_string_tab[221]
#define __pyx_n_u_Table __pyx_string_tab[222]
#define __pyx_n_u_TaggedRecordBatch __pyx_string_tab[223]
#define __pyx_n_u_TaggedRecordBatchIterator __pyx_string_tab[224]
#define __pyx_n_u_TaggedRecordBatchIterator___redu __pyx_string_tab[225]
#define __pyx_n_u_TaggedRecordBatchIterator___sets __pyx_string_tab[226]
#define __pyx_n_u_UnionDataset __pyx_string_tab[227]
#define __pyx_n_u_UnionDatasetFactory __pyx_string_tab[228]
#define __pyx_n_u_UnionDatasetFactory___reduce_cyt __pyx_string_tab[229]
#define __pyx_n_u_UnionDatasetFactory___setstate_c __pyx_string_tab[230]
#define __pyx_n_u_UnionDataset___reduce __pyx_string_tab[231]
#define __pyx_n_u_WrittenFile __pyx_string_tab[232]
#define __pyx_n_u_WrittenFile___reduce_cython __pyx_string_tab[233]
#define __pyx_n_u_WrittenFile___setstate_cython __pyx_string_tab[234]
#define __pyx_n_u_arg __pyx_string_tab[235]
#define __pyx_n_u_args __pyx_string_tab[236]
#define __pyx_n_u_array __pyx_string_tab[237]
#define __pyx_n_u_arrow __pyx_string_tab[238]
#define __pyx_n_u_arrow_c_stream __pyx_string_tab[239]
#define __pyx_n_u_as_py __pyx_string_tab[240]
#define __pyx_n_u_ascending __pyx_string_tab[241]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[242]
#define __pyx_n_u_base_dir __pyx_string_tab[243]
#define __pyx_n_u_basename_template __pyx_string_tab[244]
#define __pyx_n_u_batch __pyx_string_tab[245]
#define __pyx_n_u_batch_iter __pyx_string_tab[246]
#define __pyx_n_u_batch_readahead __pyx_string_tab[247]
#define __pyx_n_u_batch_size __pyx_string_tab[248]
#define __pyx_n_u_buffer __pyx_string_tab[249]
#define __pyx_n_u_builder __pyx_string_tab[250]
#define __pyx_n_u_by __pyx_string_tab[251]
#define __pyx_n_u_c_field_names __pyx_string_tab[252]
#define __pyx_n_u_c_filesystem __pyx_string_tab[253]
#define __pyx_n_u_c_filter __pyx_string_tab[254]
#define __pyx_n_u_c_fragment __pyx_string_tab[255]
#define __pyx_n_u_c_fragments __pyx_string_tab[256]
#define __pyx_n_u_c_indices __pyx_string_tab[257]
#define __pyx_n_u_c_options __pyx_string_tab[258]
#define __pyx_n_u_c_path __pyx_string_tab[259]
#define __pyx_n_u_c_result __pyx_string_tab[260]
#define __pyx_n_u_c_scan_options __pyx_string_tab[261]
#define __pyx_n_u_c_scanner __pyx_string_tab[262]
#define __pyx_n_u_c_schema __pyx_string_tab[263]
#define __pyx_n_u_c_source __pyx_string_tab[264]
#define __pyx_n_u_cache_metadata __pyx_string_tab[265]
#define __pyx_n_u_children __pyx_string_tab[266]
#define __pyx_n_u_class __pyx_string_tab[267]
#define __pyx_n_u_class_2 __pyx_string_tab[268]
#define __pyx_n_u_class_getitem __pyx_string_tab[269]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[270]
#define __pyx_n_u_close __pyx_string_tab[271]
#define __pyx_n_u_cls __pyx_string_tab[272]
#define __pyx_n_u_coalesce_keys __pyx_string_tab[273]
#define __pyx_n_u_codecs __pyx_string_tab[274]
#define __pyx_n_u_collections __pyx_string_tab[275]
#define __pyx_n_u_columns __pyx_string_tab[276]
#define __pyx_n_u_constructor_directory_partition __pyx_string_tab[277]
#define __pyx_n_u_constructor_filename_partitioni __pyx_string_tab[278]
#define __pyx_n_u_constructor_hive_partitioning_f __pyx_string_tab[279]
#define __pyx_n_u_convert_options __pyx_string_tab[280]
#define __pyx_n_u_copy __pyx_string_tab[281]
#define __pyx_n_u_count_rows __pyx_string_tab[282]
#define __pyx_n_u_create_dir __pyx_string_tab[283]
#define __pyx_n_u_csv __pyx_string_tab[284]
#define __pyx_n_u_current_filter __pyx_string_tab[285]
#define __pyx_n_u_d __pyx_string_tab[286]
#define __pyx_n_u_data __pyx_string_tab[287]
#define __pyx_n_u_dataset __pyx_string_tab[288]
#define __pyx_n_u_dataset_parquet __pyx_string_tab[289]
#define __pyx_n_u_dataset_pq __pyx_string_tab[290]
#define __pyx_n_u_default __pyx_string_tab[291]
#define __pyx_n_u_default_fragment_scan_options __pyx_string_tab[292]
#define __pyx_n_u_delete_matching __pyx_string_tab[293]
#define __pyx_n_u_dict __pyx_string_tab[294]
#define __pyx_n_u_dict_2 __pyx_string_tab[295]
#define __pyx_n_u_dictionaries __pyx_string_tab[296]
#define __pyx_n_u_directory __pyx_string_tab[297]
#define __pyx_n_u_discover __pyx_string_tab[298]
#define __pyx_n_u_doc __pyx_string_tab[299]
#define __pyx_n_u_e __pyx_string_tab[300]
#define __pyx_n_u_enumerate __pyx_string_tab[301]
#define __pyx_n_u_equals __pyx_string_tab[302]
#define __pyx_n_u_error __pyx_string_tab[303]
#define __pyx_n_u_exclude_invalid_files __pyx_string_tab[304]
#define __pyx_n_u_existing_data_behavior __pyx_string_tab[305]
#define __pyx_n_u_expr __pyx_string_tab[306]
#define __pyx_n_u_expression __pyx_string_tab[307]
#define __pyx_n_u_expressions __pyx_string_tab[308]
#define __pyx_n_u_f __pyx_string_tab[309]
#define __pyx_n_u_factories __pyx_string_tab[310]
#define __pyx_n_u_feather __pyx_string_tab[311]
#define __pyx_n_u_field_names __pyx_string_tab[312]
#define __pyx_n_u_file __pyx_string_tab[313]
#define __pyx_n_u_file_options __pyx_string_tab[314]
#define __pyx_n_u_file_size __pyx_string_tab[315]
#define __pyx_n_u_file_visitor __pyx_string_tab[316]
#define __pyx_n_u_filename __pyx_string_tab[317]
#define __pyx_n_u_filesystem __pyx_string_tab[318]
#define __pyx_n_u_filesystemdataset_write __pyx_string_tab[319]
#define __pyx_n_u_filter __pyx_string_tab[320]
#define __pyx_n_u_filtered_dataset __pyx_string_tab[321]
#define __pyx_n_u_finish __pyx_string_tab[322]
#define __pyx_n_u_forbid_instantiation __pyx_string_tab[323]
#define __pyx_n_u_format __pyx_string_tab[324]
#define __pyx_n_u_fragment __pyx_string_tab[325]
#define __pyx_n_u_fragment_readahead __pyx_string_tab[326]
#define __pyx_n_u_fragment_scan_options __pyx_string_tab[327]
#define __pyx_n_u_fragments __pyx_string_tab[328]
#define __pyx_n_u_from_batches __pyx_string_tab[329]
#define __pyx_n_u_from_dataset __pyx_string_tab[330]
#define __pyx_n_u_from_fragment __pyx_string_tab[331]
#define __pyx_n_u_from_paths __pyx_string_tab[332]
#define __pyx_n_u_from_stream __pyx_string_tab[333]
#define __pyx_n_u_frombytes __pyx_string_tab[334]
#define __pyx_n_u_func __pyx_string_tab[335]
#define __pyx_n_u_get __pyx_string_tab[336]
#define __pyx_n_u_get_fragments __pyx_string_tab[337]
#define __pyx_n_u_get_fragments_2 __pyx_string_tab[338]
#define __pyx_n_u_get_orc_fileformat __pyx_string_tab[339]
#define __pyx_n_u_get_parquet_classes __pyx_string_tab[340]
#define __pyx_n_u_get_parquet_symbol __pyx_string_tab[341]
#define __pyx_n_u_get_partition_keys __pyx_string_tab[342]
#define __pyx_n_u_getstate __pyx_string_tab[343]
#define __pyx_n_u_head __pyx_string_tab[344]
#define __pyx_n_u_hive __pyx_string_tab[345]
#define __pyx_n_u_i __pyx_string_tab[346]
#define __pyx_n_u_implicit_ordering __pyx_string_tab[347]
#define __pyx_n_u_indices __pyx_string_tab[348]
#define __pyx_n_u_infer_dictionary __pyx_string_tab[349]
#define __pyx_n_u_init __pyx_string_tab[350]
#define __pyx_n_u_inspect __pyx_string_tab[351]
#define __pyx_n_u_inspect_schemas __pyx_string_tab[352]
#define __pyx_n_u_ipc __pyx_string_tab[353]
#define __pyx_n_u_is_coroutine __pyx_string_tab[354]
#define __pyx_n_u_is_iterable __pyx_string_tab[355]
#define __pyx_n_u_is_path_like __pyx_string_tab[356]
#define __pyx_n_u_items __pyx_string_tab[357]
#define __pyx_n_u_iterator __pyx_string_tab[358]
#define __pyx_n_u_iterator_2 __pyx_string_tab[359]
#define __pyx_n_u_join __pyx_string_tab[360]
#define __pyx_n_u_join_asof __pyx_string_tab[361]
#define __pyx_n_u_join_type __pyx_string_tab[362]
#define __pyx_n_u_json __pyx_string_tab[363]
#define __pyx_n_u_keys __pyx_string_tab[364]
#define __pyx_n_u_kwargs __pyx_string_tab[365]
#define __pyx_n_u_left_suffix __pyx_string_tab[366]
#define __pyx_n_u_lookup __pyx_string_tab[367]
#define __pyx_n_u_main __pyx_string_tab[368]
#define __pyx_n_u_make_fragment __pyx_string_tab[369]
#define __pyx_n_u_make_write_options __pyx_string_tab[370]
#define __pyx_n_u_max_open_files __pyx_string_tab[371]
#define __pyx_n_u_max_partition_dictionary_size __pyx_string_tab[372]
#define __pyx_n_u_max_partitions __pyx_string_tab[373]
#define __pyx_n_u_max_rows_per_file __pyx_string_tab[374]
#define __pyx_n_u_max_rows_per_group __pyx_string_tab[375]
#define __pyx_n_u_maybe_fragment __pyx_string_tab[376]
#define __pyx_n_u_memory_pool __pyx_string_tab[377]
#define __pyx_n_u_metaclass __pyx_string_tab[378]
#define __pyx_n_u_metadata __pyx_string_tab[379]
#define __pyx_n_u_min_rows_per_group __pyx_string_tab[380]
#define __pyx_n_u_module __pyx_string_tab[381]
#define __pyx_n_u_mro_entries __pyx_string_tab[382]
#define __pyx_n_u_name __pyx_string_tab[383]
#define __pyx_n_u_name_2 __pyx_string_tab[384]
#define __pyx_n_u_namedtuple __pyx_string_tab[385]
#define __pyx_n_u_names __pyx_string_tab[386]
#define __pyx_n_u_new __pyx_string_tab[387]
#define __pyx_n_u_new_filter __pyx_string_tab[388]
#define __pyx_n_u_new_options __pyx_string_tab[389]
#define __pyx_n_u_next __pyx_string_tab[390]
#define __pyx_n_u_none __pyx_string_tab[391]
#define __pyx_n_u_null_fallback __pyx_string_tab[392]
#define __pyx_n_u_num_rows __pyx_string_tab[393]
#define __pyx_n_u_on __pyx_string_tab[394]
#define __pyx_n_u_open __pyx_string_tab[395]
#define __pyx_n_u_opened __pyx_string_tab[396]
#define __pyx_n_u_options __pyx_string_tab[397]
#define __pyx_n_u_opts __pyx_string_tab[398]
#define __pyx_n_u_orc __pyx_string_tab[399]
#define __pyx_n_u_orc_fileformat __pyx_string_tab[400]
#define __pyx_n_u_orc_imported __pyx_string_tab[401]
#define __pyx_n_u_other __pyx_string_tab[402]
#define __pyx_n_u_out __pyx_string_tab[403]
#define __pyx_n_u_output_type __pyx_string_tab[404]
#define __pyx_n_u_overwrite_or_ignore __pyx_string_tab[405]
#define __pyx_n_u_pa __pyx_string_tab[406]
#define __pyx_n_u_pa_substrait __pyx_string_tab[407]
#define __pyx_n_u_pac __pyx_string_tab[408]
#define __pyx_n_u_parquet __pyx_string_tab[409]
#define __pyx_n_u_parse __pyx_string_tab[410]
#define __pyx_n_u_parse_options __pyx_string_tab[411]
#define __pyx_n_u_partition_base_dir __pyx_string_tab[412]
#define __pyx_n_u_partition_expression __pyx_string_tab[413]
#define __pyx_n_u_partitioning __pyx_string_tab[414]
#define __pyx_n_u_partitioning_factory __pyx_string_tab[415]
#define __pyx_n_u_partitions __pyx_string_tab[416]
#define __pyx_n_u_path_2 __pyx_string_tab[417]
#define __pyx_n_u_paths __pyx_string_tab[418]
#define __pyx_n_u_paths_or_selector __pyx_string_tab[419]
#define __pyx_n_u_perform_join __pyx_string_tab[420]
#define __pyx_n_u_perform_join_asof __pyx_string_tab[421]
#define __pyx_n_u_physical_schema __pyx_string_tab[422]
#define __pyx_n_u_pop __pyx_string_tab[423]
#define __pyx_n_u_prepare __pyx_string_tab[424]
#define __pyx_n_u_preserve_order __pyx_string_tab[425]
#define __pyx_n_u_promote_options __pyx_string_tab[426]
#define __pyx_n_u_pyarrow __pyx_string_tab[427]
#define __pyx_n_u_pyarrow__compute __pyx_string_tab[428]
#define __pyx_n_u_pyarrow__dataset __pyx_string_tab[429]
#define __pyx_n_u_pyarrow__dataset_orc __pyx_string_tab[430]
#define __pyx_n_u_pyarrow__dataset_parquet __pyx_string_tab[431]
#define __pyx_n_u_pyarrow_lib __pyx_string_tab[432]
#define __pyx_n_u_pyarrow_substrait __pyx_string_tab[433]
#define __pyx_n_u_pyarrow_util __pyx_string_tab[434]
#define __pyx_n_u_pyx_capi __pyx_string_tab[435]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[436]
#define __pyx_n_u_pyx_result __pyx_string_tab[437]
#define __pyx_n_u_pyx_state __pyx_string_tab[438]
#define __pyx_n_u_pyx_type __pyx_string_tab[439]
#define __pyx_n_u_pyx_unpickle_WrittenFile __pyx_string_tab[440]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[441]
#define __pyx_n_u_qualname __pyx_string_tab[442]
#define __pyx_n_u_read __pyx_string_tab[443]
#define __pyx_n_u_read_options __pyx_string_tab[444]
#define __pyx_n_u_read_options_py __pyx_string_tab[445]
#define __pyx_n_u_reader __pyx_string_tab[446]
#define __pyx_n_u_record_batch __pyx_string_tab[447]
#define __pyx_n_u_reduce __pyx_string_tab[448]
#define __pyx_n_u_reduce_cython __pyx_string_tab[449]
#define __pyx_n_u_reduce_ex __pyx_string_tab[450]
#define __pyx_n_u_ref_val __pyx_string_tab[451]
#define __pyx_n_u_replace_schema __pyx_string_tab[452]
#define __pyx_n_u_requested_filter __pyx_string_tab[453]
#define __pyx_n_u_require_sequenced_output __pyx_string_tab[454]
#define __pyx_n_u_res __pyx_string_tab[455]
#define __pyx_n_u_result __pyx_string_tab[456]
#define __pyx_n_u_right_by __pyx_string_tab[457]
#define __pyx_n_u_right_dataset __pyx_string_tab[458]
#define __pyx_n_u_right_keys __pyx_string_tab[459]
#define __pyx_n_u_right_on __pyx_string_tab[460]
#define __pyx_n_u_right_suffix __pyx_string_tab[461]
#define __pyx_n_u_root_partition __pyx_string_tab[462]
#define __pyx_n_u_s __pyx_string_tab[463]
#define __pyx_n_u_scalar __pyx_string_tab[464]
#define __pyx_n_u_scan_batches __pyx_string_tab[465]
#define __pyx_n_u_scan_options __pyx_string_tab[466]
#define __pyx_n_u_scan_options_2 __pyx_string_tab[467]
#define __pyx_n_u_scanner __pyx_string_tab[468]
#define __pyx_n_u_scanner_options __pyx_string_tab[469]
#define __pyx_n_u_schema __pyx_string_tab[470]
#define __pyx_n_u_schemas __pyx_string_tab[471]
#define __pyx_n_u_segment_encoding __pyx_string_tab[472]
#define __pyx_n_u_selector_ignore_prefixes __pyx_string_tab[473]
#define __pyx_n_u_self __pyx_string_tab[474]
#define __pyx_n_u_send __pyx_string_tab[475]
#define __pyx_n_u_set_default_fragment_scan_optio __pyx_string_tab[476]
#define __pyx_n_u_set_name __pyx_string_tab[477]
#define __pyx_n_u_set_options __pyx_string_tab[478]
#define __pyx_n_u_setdefault __pyx_string_tab[479]
#define __pyx_n_u_setstate __pyx_string_tab[480]
#define __pyx_n_u_setstate_cython __pyx_string_tab[481]
#define __pyx_n_u_size __pyx_string_tab[482]
#define __pyx_n_u_slots __pyx_string_tab[483]
#define __pyx_n_u_sort_by __pyx_string_tab[484]
#define __pyx_n_u_sort_keys __pyx_string_tab[485]
#define __pyx_n_u_sort_source __pyx_string_tab[486]
#define __pyx_n_u_sorting __pyx_string_tab[487]
#define __pyx_n_u_source __pyx_string_tab[488]
#define __pyx_n_u_sp_schema __pyx_string_tab[489]
#define __pyx_n_u_sp_write_options __pyx_string_tab[490]
#define __pyx_n_u_state __pyx_string_tab[491]
#define __pyx_n_u_staticmethod __pyx_string_tab[492]
#define __pyx_n_u_stringify_path __pyx_string_tab[493]
#define __pyx_n_u_subclasses_instead __pyx_string_tab[494]
#define __pyx_n_u_substrait __pyx_string_tab[495]
#define __pyx_n_u_super __pyx_string_tab[496]
#define __pyx_n_u_take __pyx_string_tab[497]
#define __pyx_n_u_test __pyx_string_tab[498]
#define __pyx_n_u_throw __pyx_string_tab[499]
#define __pyx_n_u_to_batches __pyx_string_tab[500]
#define __pyx_n_u_to_batches_locals__iterator __pyx_string_tab[501]
#define __pyx_n_u_to_reader __pyx_string_tab[502]
#define __pyx_n_u_to_table __pyx_string_tab[503]
#define __pyx_n_u_tobytes __pyx_string_tab[504]
#define __pyx_n_u_tolerance __pyx_string_tab[505]
#define __pyx_n_u_type_2 __pyx_string_tab[506]
#define __pyx_n_u_type_name __pyx_string_tab[507]
#define __pyx_n_u_union __pyx_string_tab[508]
#define __pyx_n_u_update __pyx_string_tab[509]
#define __pyx_n_u_uri __pyx_string_tab[510]
#define __pyx_n_u_use_setstate __pyx_string_tab[511]
#define __pyx_n_u_use_threads __pyx_string_tab[512]
#define __pyx_n_u_val __pyx_string_tab[513]
#define __pyx_n_u_value __pyx_string_tab[514]
#define __pyx_n_u_values __pyx_string_tab[515]
#define __pyx_n_u_visit_args __pyx_string_tab[516]
#define __pyx_n_u_write_options __pyx_string_tab[517]
#define __pyx_n_u_zip __pyx_string_tab[518]
#define __pyx_kp_b_arrow_Field_MergeOptions_PyObje __pyx_string_tab[519]
#define __pyx_kp_b_arrow_compute_Expression__true __pyx_string_tab[520]
#define __pyx_kp_b_arrow_compute_Expression_struct __pyx_string_tab[521]
#define __pyx_kp_b_arrow_dataset_FileSource_PyObjec __pyx_string_tab[522]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[523]
#define __pyx_kp_b_iso88591_1_7_Qa_X_6aq_XWA_e1N_1 __pyx_string_tab[524]
#define __pyx_kp_b_iso88591_2_wa_6_wfE_Cq_wgU_S_q_1IQfG6_hc __pyx_string_tab[525]
#define __pyx_kp_b_iso88591_2_wa_WA_q_q_q_1_1_c_1_1_1_1_j_1 __pyx_string_tab[526]
#define __pyx_kp_b_iso88591_33C1_N_c_t2_1_vV_1 __pyx_string_tab[527]
#define __pyx_kp_b_iso88591_3a __pyx_string_tab[528]
#define __pyx_kp_b_iso88591_9Ba __pyx_string_tab[529]
#define __pyx_kp_b_iso88591_A __pyx_string_tab[530]
#define __pyx_kp_b_iso88591_ACD_Q_A_A_x_0_81_a_DAQ_7wd_1_A_B __pyx_string_tab[531]
#define __pyx_kp_b_iso88591_A_0_H_c_q_3a_Qa_1_1_Z_4AQ_1_q_a __pyx_string_tab[532]
#define __pyx_kp_b_iso88591_A_1_31IQ_T_2Na_d_HF_t3CC __pyx_string_tab[533]
#define __pyx_kp_b_iso88591_A_1_j_at83Gq_q __pyx_string_tab[534]
#define __pyx_kp_b_iso88591_A_31_DA_Q_Q_E_XQ_Q_t_Qe1_iq_EQfA __pyx_string_tab[535]
#define __pyx_kp_b_iso88591_A_4A_0_qH_c_q_3a_Qa_1_1_Z_4AQ_AW __pyx_string_tab[536]
#define __pyx_kp_b_iso88591_A_4A_q_1_1_Z_4AQ_AWAQgT_a_1_AWAS __pyx_string_tab[537]
#define __pyx_kp_b_iso88591_A_4w_4s_Q_Q_uAQ __pyx_string_tab[538]
#define __pyx_kp_b_iso88591_A_4z_2Q_b_aq_T_6 __pyx_string_tab[539]
#define __pyx_kp_b_iso88591_A_78_z_t81_A_1_q_A_q_1_aq __pyx_string_tab[540]
#define __pyx_kp_b_iso88591_A_A __pyx_string_tab[541]
#define __pyx_kp_b_iso88591_A_A_A __pyx_string_tab[542]
#define __pyx_kp_b_iso88591_A_A_A_8_A_0_A_q_awgT_BgQ_e1A __pyx_string_tab[543]
#define __pyx_kp_b_iso88591_A_C1_A_N_Qhb_A_q_j_Q_AXQ_q_j_Rt __pyx_string_tab[544]
#define __pyx_kp_b_iso88591_A_F_wnA_1_A_1_q_A_q_1 __pyx_string_tab[545]
#define __pyx_kp_b_iso88591_A_M_1 __pyx_string_tab[546]
#define __pyx_kp_b_iso88591_A_P_t81_1_q_A_q_1_A __pyx_string_tab[547]
#define __pyx_kp_b_iso88591_A_Q_4q_d_WA_4z_a_Qd_QgQ_q __pyx_string_tab[548]
#define __pyx_kp_b_iso88591_A_Q_t7_Q __pyx_string_tab[549]
#define __pyx_kp_b_iso88591_A_Qiq_b_d_M_z_A_q __pyx_string_tab[550]
#define __pyx_kp_b_iso88591_A_T __pyx_string_tab[551]
#define __pyx_kp_b_iso88591_A_T_1_Qa __pyx_string_tab[552]
#define __pyx_kp_b_iso88591_A_T_2 __pyx_string_tab[553]
#define __pyx_kp_b_iso88591_A_T_E_q_7_aq_q __pyx_string_tab[554]
#define __pyx_kp_b_iso88591_A_T_aq __pyx_string_tab[555]
#define __pyx_kp_b_iso88591_A_WAU_gQe1 __pyx_string_tab[556]
#define __pyx_kp_b_iso88591_A_Zq_4xwa_2_4q_4_WBk_Cq_WAT_wb_Q __pyx_string_tab[557]
#define __pyx_kp_b_iso88591_A_a_31_Q __pyx_string_tab[558]
#define __pyx_kp_b_iso88591_A_a_Qa __pyx_string_tab[559]
#define __pyx_kp_b_iso88591_A_d_4q __pyx_string_tab[560]
#define __pyx_kp_b_iso88591_A_e1 __pyx_string_tab[561]
#define __pyx_kp_b_iso88591_A_gQe_1_q __pyx_string_tab[562]
#define __pyx_kp_b_iso88591_A_gU_7_aq_Ja_9_Q_a_7_s_1_j_q_7_1 __pyx_string_tab[563]
#define __pyx_kp_b_iso88591_A_q __pyx_string_tab[564]
#define __pyx_kp_b_iso88591_A_q_1 __pyx_string_tab[565]
#define __pyx_kp_b_iso88591_A_q_A_q __pyx_string_tab[566]
#define __pyx_kp_b_iso88591_A_q_M_Qa_y_IQfA __pyx_string_tab[567]
#define __pyx_kp_b_iso88591_A_q__Cq_q __pyx_string_tab[568]
#define __pyx_kp_b_iso88591_A_q_a_AQ_5_Qa_4q_d_Q_q __pyx_string_tab[569]
#define __pyx_kp_b_iso88591_A_q_q_WAU __pyx_string_tab[570]
#define __pyx_kp_b_iso88591_A_t1N_4x_1_QfD __pyx_string_tab[571]
#define __pyx_kp_b_iso88591_A_t1_1 __pyx_string_tab[572]
#define __pyx_kp_b_iso88591_A_t1_1_4q_1D_xq_1_a_Q_q_a __pyx_string_tab[573]
#define __pyx_kp_b_iso88591_A_t1_1_4q_1D_xq_1_a_t_I_1 __pyx_string_tab[574]
#define __pyx_kp_b_iso88591_A_t81_1_A_1_q_A_q_1 __pyx_string_tab[575]
#define __pyx_kp_b_iso88591_A_t81_A_1_q_A_q_1 __pyx_string_tab[576]
#define __pyx_kp_b_iso88591_A_t_Q __pyx_string_tab[577]
#define __pyx_kp_b_iso88591_A_v_t81_A_1_q_A_q_1_A __pyx_string_tab[578]
#define __pyx_kp_b_iso88591_A_wm1_A_1_q_A_q_1 __pyx_string_tab[579]
#define __pyx_kp_b_iso88591_A_y __pyx_string_tab[580]
#define __pyx_kp_b_iso88591_A_z_wnA_1_A_1_q_A_q_1_A __pyx_string_tab[581]
#define __pyx_kp_b_iso88591_C_RSx_9Cq_q_9Cq_q_t2_t1_8_4L __pyx_string_tab[582]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[583]
#define __pyx_kp_b_iso88591_Q67_1_1_AV_q_1_AT_9_uAT __pyx_string_tab[584]
#define __pyx_kp_b_iso88591_T_D_t1_G1F_a_vWE_Q_q_t_WE_D_gQ __pyx_string_tab[585]
#define __pyx_kp_b_iso88591__57 __pyx_string_tab[586]
#define __pyx_kp_b_iso88591__58 __pyx_string_tab[587]
#define __pyx_kp_b_iso88591_a_4_T_G1_A_t_1 __pyx_string_tab[588]
#define __pyx_kp_b_iso88591_a_S_q_5_Jc_A_I_T __pyx_string_tab[589]
#define __pyx_kp_b_iso88591_q_0_kQR_haq_7_QnN_1 __pyx_string_tab[590]
#define __pyx_kp_b_iso88591_q_4AV_QQR_t7_1_4q __pyx_string_tab[591]
#define __pyx_kp_b_iso88591_t1_Q_a_a_a_A_1 __pyx_string_tab[592]
#define __pyx_kp_b_iso88591_t7 __pyx_string_tab[593]
#define __pyx_kp_b_iso88591_y __pyx_string_tab[594]
#define __pyx_int_0 __pyx_number_tab[0]
#define __pyx_int_neg_1 __pyx_number_tab[1]
#define __pyx_int_1 __pyx_number_tab[2]
#define __pyx_int_4 __pyx_number_tab[3]
#define __pyx_int_16 __pyx_number_tab[4]
#define __pyx_int_131072 __pyx_number_tab[5]
#define __pyx_int_45017777 __pyx_number_tab[6]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Weakrefable);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IpcReadOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Message);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MemoryPool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DataType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListViewType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MapType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StructType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryMemo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_TimestampType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Time32Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Time64Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DurationType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BaseExtensionType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Bool8Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_OpaqueType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UuidType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_JsonType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Metadata);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Field);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Schema);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Scalar);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ArrayStatistics);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__PandasConvertible);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Tensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NullArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BooleanArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NumericArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IntegerArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FloatingPointArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int8Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt8Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int16Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt16Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_HalfFloatArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FloatArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DoubleArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StructArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BaseListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MapArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UnionArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StringArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BinaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StringViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BinaryViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ChunkedArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Tabular);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Table);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatch);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Device);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MemoryManager);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Buffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ResizableBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NativeFile);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BufferedInputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CompressedInputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CacheOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Codec);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StopToken);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_FileInfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_FileSelector);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_FileSystem);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_LocalFileSystem);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs__MockFileSystem);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3_fs_PyFileSystem);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_6_acero_Declaration);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_compute_UdfContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_compute_FunctionOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_compute__SortOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_compute_Expression);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_4_csv_ConvertOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_4_csv_ParseOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_4_csv_ReadOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_4_csv_WriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_5_json_ParseOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_5_json_ReadOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_DatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_Dataset);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_Dataset);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_Scanner);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileFormat);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_Fragment);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_Fragment);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileFragment);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileFragment);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_Partitioning);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_Partitioning);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_PartitioningFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_WrittenFile);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_WrittenFile);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_InMemoryDataset);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_UnionDataset);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_UnionDataset);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemDataset);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_IpcFileFormat);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FeatherFileFormat);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_CsvFileFormat);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_JsonFileFormat);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_HivePartitioning);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FilenamePartitioning);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_RecordBatchIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset__ScanNodeOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator);
  for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<109; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<595; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* Generator.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Weakrefable);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IpcReadOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Message);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MemoryPool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DataType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListViewType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MapType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StructType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryMemo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_TimestampType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Time32Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Time64Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DurationType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BaseExtensionType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Bool8Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_OpaqueType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UuidType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_JsonType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Metadata);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Field);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Schema);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Scalar);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ArrayStatistics);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__PandasConvertible);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Tensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NullArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BooleanArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NumericArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IntegerArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FloatingPointArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int8Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt8Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int16Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt16Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_HalfFloatArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FloatArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DoubleArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StructArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BaseListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MapArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UnionArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StringArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BinaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StringViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BinaryViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ChunkedArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Tabular);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Table);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatch);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Device);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MemoryManager);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Buffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ResizableBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NativeFile);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BufferedInputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CompressedInputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CacheOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Codec);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StopToken);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_FileInfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_FileSelector);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_FileSystem);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_LocalFileSystem);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs__MockFileSystem);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3_fs_PyFileSystem);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_6_acero_Declaration);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_compute_UdfContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_compute_FunctionOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_compute__SortOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_compute_Expression);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_4_csv_ConvertOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_4_csv_ParseOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_4_csv_ReadOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_4_csv_WriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_5_json_ParseOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_5_json_ReadOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_DatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_Dataset);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_Dataset);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_Scanner);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileFormat);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_Fragment);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_Fragment);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileFragment);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileFragment);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_Partitioning);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_Partitioning);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_PartitioningFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_WrittenFile);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_WrittenFile);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_InMemoryDataset);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_UnionDataset);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_UnionDataset);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemDataset);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_IpcFileFormat);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FeatherFileFormat);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_CsvFileFormat);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_JsonFileFormat);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_HivePartitioning);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FilenamePartitioning);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_RecordBatchIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset__ScanNodeOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator);
  for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<109; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<595; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* Generator.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  char const *__pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, <size_t> length)
*/
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, <size_t> length)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 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, <size_t> length)             # <<<<<<<<<<<<<<
 * 
*/
  try {
    __pyx_t_2 = std::string(__pyx_v_data, ((size_t)__pyx_v_length));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 16, __pyx_L1_error)
  }
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "string.to_py":31
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":33
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":34
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 34, __pyx_L1_error)

    /* "string.to_py":33
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":35
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_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":39
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":41
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":42
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 42, __pyx_L1_error)

    /* "string.to_py":41
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":43
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":39
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_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":47
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":49
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":50
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 50, __pyx_L1_error)

    /* "string.to_py":49
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":51
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); 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;

  /* "string.to_py":47
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_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
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":57
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":58
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
    PyErr_NoMemory(); __PYX_ERR(1, 58, __pyx_L1_error)

    /* "string.to_py":57
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":59
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @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 *:
 * 
*/

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;
  Py_ssize_t __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":55
 * 
 *     cdef vector[X] v
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)             # <<<<<<<<<<<<<<
 * 
 *     if s > 0:
*/
  __pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(1, 55, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "vector.from_py":57
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  __pyx_t_2 = (__pyx_v_s > 0);
  if (__pyx_t_2) {

    /* "vector.from_py":58
 * 
 *     if s > 0:
 *         v.reserve(<size_t> s)             # <<<<<<<<<<<<<<
 * 
 *     for item in o:
*/
    try {
      __pyx_v_v.reserve(((size_t)__pyx_v_s));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 58, __pyx_L1_error)
    }

    /* "vector.from_py":57
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  }

  /* "vector.from_py":60
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 60, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 60, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 60, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "vector.from_py":61
 * 
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 * 
 *     return v
*/
    __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
    try {
      __pyx_v_v.push_back(((std::string)__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 61, __pyx_L1_error)
    }

    /* "vector.from_py":60
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vector.from_py":63
 *         v.push_back(<X>item)
 * 
 *     return v             # <<<<<<<<<<<<<<
 * 
*/
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @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 *:
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

/* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":29
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
*/
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":121
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":122
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 122, __pyx_L1_error)

  /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":125
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
*/
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":128
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":129
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
*/
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":130
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":140
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":141
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 141, __pyx_L1_error)

  /* "cpython/contextvars.pxd":143
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":144
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
*/
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":145
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/datetime.pxd":44
 * 
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":46
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":44
 * 
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":48
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":50
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":48
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":52
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":54
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
*/
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":52
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":57
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":59
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":57
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":61
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":63
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":61
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":65
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":67
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":65
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":69
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":71
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":69
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":73
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 0);

  /* "cpython/datetime.pxd":75
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":73
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
*/

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

/* "cpython/datetime.pxd":77
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":80
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
*/
  __pyx_r = PyDateTime_TIME_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":77
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":83
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":85
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":83
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":87
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":89
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":87
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":91
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":93
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":91
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":95
 *             return PyDateTime_GET_DAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":97
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":95
 *             return PyDateTime_GET_DAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":99
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":101
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":99
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":103
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":105
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":103
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":107
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":109
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":107
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":111
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 0);

  /* "cpython/datetime.pxd":113
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":111
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
*/

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

/* "cpython/datetime.pxd":115
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":118
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
*/
  __pyx_r = PyDateTime_DATE_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":115
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":121
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":123
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":121
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":125
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":127
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":125
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":129
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":131
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.tzinfo[object PyDateTime_TZInfo]:
*/
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":129
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":255
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
*/

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {

  /* "cpython/datetime.pxd":256
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
*/
  (void)(PyDateTime_IMPORT);

  /* "cpython/datetime.pxd":255
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
*/

  /* function exit code */
}

/* "cpython/datetime.pxd":260
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
*/

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_new", 0);

  /* "cpython/datetime.pxd":261
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":260
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":266
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_TimeWithFold(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(3, 266, __pyx_L1_error)
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":271
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_DateTimeWithFold(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":275
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
*/

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timedelta_new", 0);

  /* "cpython/datetime.pxd":276
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":275
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *__pyx_v_offset, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args) {
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timezone_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_name = __pyx_optional_args->name;
    }
  }

  /* "cpython/datetime.pxd":280
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DB API constructor.
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_name != Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = ((PyObject *)__pyx_v_name);
  } else {
    __pyx_t_1 = NULL;
  }
  __pyx_t_3 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.datetime.timezone_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *__pyx_v_timestamp, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_from_timestamp", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cpython/datetime.pxd":284
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cpython/datetime.pxd":285
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DB API constructor.
*/
  __pyx_t_2 = (__pyx_v_tz != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tz);
    __Pyx_GIVEREF(__pyx_v_tz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tz) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "cpython/datetime.pxd":284
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
*/
  __pyx_t_3 = ((PyObject *)PyDateTimeAPI->DateTime_FromTimestamp(((PyObject *)PyDateTimeAPI->DateTimeType), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.datetime.datetime_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":288
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
*/

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *__pyx_v_timestamp) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_from_timestamp", 0);

  /* "cpython/datetime.pxd":289
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_timestamp);
  __Pyx_GIVEREF(__pyx_v_timestamp);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 289, __pyx_L1_error);
  __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":288
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.date_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":297
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_utc", 0);

  /* "cpython/datetime.pxd":298
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     return <object>__Pyx_TimeZone_UTC             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of time
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__Pyx_TimeZone_UTC));
  __pyx_r = ((PyObject *)__Pyx_TimeZone_UTC);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":297
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
*/

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

/* "cpython/datetime.pxd":301
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 0);

  /* "cpython/datetime.pxd":302
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":301
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
*/

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

/* "cpython/datetime.pxd":305
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 0);

  /* "cpython/datetime.pxd":306
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":305
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
*/

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

/* "cpython/datetime.pxd":309
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":310
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
*/
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":309
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":313
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":314
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
*/
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":313
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":317
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":318
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
*/
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":317
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":321
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":322
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
*/
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":321
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":325
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":326
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
*/
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":325
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":329
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":330
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
*/
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":329
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":333
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":334
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
*/
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":333
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":337
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":338
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
*/
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":337
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":341
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":342
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
*/
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":341
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":345
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":346
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of time
*/
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":345
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":349
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":351
 * cdef inline int time_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
*/
  __pyx_r = PyDateTime_TIME_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":349
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":354
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":355
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":354
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":358
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":359
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":358
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":362
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":363
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":362
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":366
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":367
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":366
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":370
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":372
 * cdef inline int datetime_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
*/
  __pyx_r = PyDateTime_DATE_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":370
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":375
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_DAYS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":376
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:
 *     return PyDateTime_DELTA_GET_DAYS(o)             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
*/
  __pyx_r = PyDateTime_DELTA_GET_DAYS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":375
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_DAYS(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":379
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_SECONDS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":380
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:
 *     return PyDateTime_DELTA_GET_SECONDS(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
*/
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":379
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_SECONDS(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":383
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":384
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:
*/
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":383
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":386
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
*/

static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *__pyx_v_obj) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_micros;
  double __pyx_r;

  /* "cpython/datetime.pxd":392
 *     cdef:
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)             # <<<<<<<<<<<<<<
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
*/
  __pyx_v_days = ((double)PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":393
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)             # <<<<<<<<<<<<<<
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
*/
  __pyx_v_seconds = ((double)PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":394
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)             # <<<<<<<<<<<<<<
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
*/
  __pyx_v_micros = ((double)PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":395
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000             # <<<<<<<<<<<<<<
*/
  __pyx_r = ((((__pyx_v_days * 24.0) * 3600.0) + __pyx_v_seconds) + (__pyx_v_micros / 1000000.0));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":386
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/includes/common.pxd":151
 * 
 * 
 * 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":153
 * 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":154
 *     # 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":155
 *     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":151
 * 
 * 
 * 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;
}

/* "pyarrow/_dataset.pyx":61
 * 
 * 
 * def _get_orc_fileformat():             # <<<<<<<<<<<<<<
 *     """
 *     Import OrcFileFormat on first usage (to avoid circular import issue
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_1_get_orc_fileformat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset__get_orc_fileformat, "_get_orc_fileformat()\n\nImport OrcFileFormat on first usage (to avoid circular import issue\nwhen `pyarrow._dataset_orc` would be imported first)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_1_get_orc_fileformat = {"_get_orc_fileformat", (PyCFunction)__pyx_pw_7pyarrow_8_dataset_1_get_orc_fileformat, METH_NOARGS, __pyx_doc_7pyarrow_8_dataset__get_orc_fileformat};
static PyObject *__pyx_pw_7pyarrow_8_dataset_1_get_orc_fileformat(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_orc_fileformat (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset__get_orc_fileformat(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset__get_orc_fileformat(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_OrcFileFormat = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  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;
  char const *__pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_orc_fileformat", 0);

  /* "pyarrow/_dataset.pyx":68
 *     global _orc_fileformat
 *     global _orc_imported
 *     if not _orc_imported:             # <<<<<<<<<<<<<<
 *         try:
 *             from pyarrow._dataset_orc import OrcFileFormat
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orc_imported); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __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(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":69
 *     global _orc_imported
 *     if not _orc_imported:
 *         try:             # <<<<<<<<<<<<<<
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat
*/
    /*try:*/ {
      {
        __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/_dataset.pyx":70
 *     if not _orc_imported:
 *         try:
 *             from pyarrow._dataset_orc import OrcFileFormat             # <<<<<<<<<<<<<<
 *             _orc_fileformat = OrcFileFormat
 *         except ImportError as e:
*/
          {
            PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_OrcFileFormat};
            __pyx_t_7 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow__dataset_orc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L7_error)
          }
          __pyx_t_1 = __pyx_t_7;
          __Pyx_GOTREF(__pyx_t_1);
          {
            PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_OrcFileFormat};
            __pyx_t_8 = 0; {
              __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_8]); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_9);
              switch (__pyx_t_8) {
                case 0:
                __Pyx_INCREF(__pyx_t_9);
                __pyx_v_OrcFileFormat = __pyx_t_9;
                break;
                default:;
              }
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            }
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "pyarrow/_dataset.pyx":71
 *         try:
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat             # <<<<<<<<<<<<<<
 *         except ImportError as e:
 *             _orc_fileformat = None
*/
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_fileformat, __pyx_v_OrcFileFormat) < (0)) __PYX_ERR(0, 71, __pyx_L7_error)

          /* "pyarrow/_dataset.pyx":69
 *     global _orc_imported
 *     if not _orc_imported:
 *         try:             # <<<<<<<<<<<<<<
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat
*/
        }
        __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_L12_try_end;
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "pyarrow/_dataset.pyx":72
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat
 *         except ImportError as e:             # <<<<<<<<<<<<<<
 *             _orc_fileformat = None
 *         finally:
*/
        __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
        if (__pyx_t_10) {
          __Pyx_AddTraceback("pyarrow._dataset._get_orc_fileformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(0, 72, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_v_e = __pyx_t_9;
          /*try:*/ {

            /* "pyarrow/_dataset.pyx":73
 *             _orc_fileformat = OrcFileFormat
 *         except ImportError as e:
 *             _orc_fileformat = None             # <<<<<<<<<<<<<<
 *         finally:
 *             _orc_imported = True
*/
            if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_fileformat, Py_None) < (0)) __PYX_ERR(0, 73, __pyx_L18_error)
          }

          /* "pyarrow/_dataset.pyx":72
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat
 *         except ImportError as e:             # <<<<<<<<<<<<<<
 *             _orc_fileformat = None
 *         finally:
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L19;
            }
            __pyx_L18_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_7 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
              if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_14, &__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_7);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_18);
              __pyx_t_10 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_7);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_ErrRestore(__pyx_t_7, __pyx_t_14, __pyx_t_15);
              __pyx_t_7 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
              __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
              goto __pyx_L9_except_error;
            }
            __pyx_L19:;
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L8_exception_handled;
        }
        goto __pyx_L9_except_error;

        /* "pyarrow/_dataset.pyx":69
 *     global _orc_imported
 *     if not _orc_imported:
 *         try:             # <<<<<<<<<<<<<<
 *             from pyarrow._dataset_orc import OrcFileFormat
 *             _orc_fileformat = OrcFileFormat
*/
        __pyx_L9_except_error:;
        __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_L5_error;
        __pyx_L8_exception_handled:;
        __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);
        __pyx_L12_try_end:;
      }
    }

    /* "pyarrow/_dataset.pyx":75
 *             _orc_fileformat = None
 *         finally:
 *             _orc_imported = True             # <<<<<<<<<<<<<<
 *     return _orc_fileformat
 * 
*/
    /*finally:*/ {
      /*normal exit:*/{
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_imported, Py_True) < (0)) __PYX_ERR(0, 75, __pyx_L1_error)
        goto __pyx_L6;
      }
      __pyx_L5_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
        if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_16);
        __pyx_t_12 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
        {
          if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_imported, Py_True) < (0)) __PYX_ERR(0, 75, __pyx_L25_error)
        }
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
        __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
        __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_19;
        goto __pyx_L1_error;
        __pyx_L25_error:;
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L6:;
    }

    /* "pyarrow/_dataset.pyx":68
 *     global _orc_fileformat
 *     global _orc_imported
 *     if not _orc_imported:             # <<<<<<<<<<<<<<
 *         try:
 *             from pyarrow._dataset_orc import OrcFileFormat
*/
  }

  /* "pyarrow/_dataset.pyx":76
 *         finally:
 *             _orc_imported = True
 *     return _orc_fileformat             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_orc_fileformat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":61
 * 
 * 
 * def _get_orc_fileformat():             # <<<<<<<<<<<<<<
 *     """
 *     Import OrcFileFormat on first usage (to avoid circular import issue
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset._get_orc_fileformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_OrcFileFormat);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":82
 * 
 * 
 * def _get_parquet_classes():             # <<<<<<<<<<<<<<
 *     """
 *     Import Parquet class files on first usage (to avoid circular import issue
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_3_get_parquet_classes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_2_get_parquet_classes, "_get_parquet_classes()\n\nImport Parquet class files on first usage (to avoid circular import issue\nwhen `pyarrow._dataset_parquet` would be imported first)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_3_get_parquet_classes = {"_get_parquet_classes", (PyCFunction)__pyx_pw_7pyarrow_8_dataset_3_get_parquet_classes, METH_NOARGS, __pyx_doc_7pyarrow_8_dataset_2_get_parquet_classes};
static PyObject *__pyx_pw_7pyarrow_8_dataset_3_get_parquet_classes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_parquet_classes (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_2_get_parquet_classes(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_2_get_parquet_classes(CYTHON_UNUSED PyObject *__pyx_self) {
  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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_parquet_classes", 0);

  /* "pyarrow/_dataset.pyx":88
 *     """
 *     global _dataset_pq
 *     if _dataset_pq is False:             # <<<<<<<<<<<<<<
 *         try:
 *             import pyarrow._dataset_parquet as _dataset_pq
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dataset_pq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_False);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":89
 *     global _dataset_pq
 *     if _dataset_pq is False:
 *         try:             # <<<<<<<<<<<<<<
 *             import pyarrow._dataset_parquet as _dataset_pq
 *         except ImportError:
*/
    {
      __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/_dataset.pyx":90
 *     if _dataset_pq is False:
 *         try:
 *             import pyarrow._dataset_parquet as _dataset_pq             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             _dataset_pq = None
*/
        __pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow__dataset_parquet, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L4_error)
        __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_dataset_parquet);
        Py_DECREF(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L4_error)
        __pyx_t_6 = __pyx_t_7;
        __pyx_t_1 = __pyx_t_6;
        __Pyx_GOTREF(__pyx_t_1);
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dataset_pq, __pyx_t_1) < (0)) __PYX_ERR(0, 90, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/_dataset.pyx":89
 *     global _dataset_pq
 *     if _dataset_pq is False:
 *         try:             # <<<<<<<<<<<<<<
 *             import pyarrow._dataset_parquet as _dataset_pq
 *         except ImportError:
*/
      }
      __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_1); __pyx_t_1 = 0;

      /* "pyarrow/_dataset.pyx":91
 *         try:
 *             import pyarrow._dataset_parquet as _dataset_pq
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             _dataset_pq = None
 * 
*/
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
      if (__pyx_t_8) {
        __Pyx_AddTraceback("pyarrow._dataset._get_parquet_classes", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 91, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "pyarrow/_dataset.pyx":92
 *             import pyarrow._dataset_parquet as _dataset_pq
 *         except ImportError:
 *             _dataset_pq = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dataset_pq, Py_None) < (0)) __PYX_ERR(0, 92, __pyx_L6_except_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;

      /* "pyarrow/_dataset.pyx":89
 *     global _dataset_pq
 *     if _dataset_pq is False:
 *         try:             # <<<<<<<<<<<<<<
 *             import pyarrow._dataset_parquet as _dataset_pq
 *         except ImportError:
*/
      __pyx_L6_except_error:;
      __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/_dataset.pyx":88
 *     """
 *     global _dataset_pq
 *     if _dataset_pq is False:             # <<<<<<<<<<<<<<
 *         try:
 *             import pyarrow._dataset_parquet as _dataset_pq
*/
  }

  /* "pyarrow/_dataset.pyx":82
 * 
 * 
 * def _get_parquet_classes():             # <<<<<<<<<<<<<<
 *     """
 *     Import Parquet class files on first usage (to avoid circular import issue
*/

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow._dataset._get_parquet_classes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":95
 * 
 * 
 * def _get_parquet_symbol(name):             # <<<<<<<<<<<<<<
 *     """
 *     Get a symbol from pyarrow.parquet if the latter is importable, otherwise
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_5_get_parquet_symbol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_4_get_parquet_symbol, "_get_parquet_symbol(name)\n\nGet a symbol from pyarrow.parquet if the latter is importable, otherwise\nreturn None.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_5_get_parquet_symbol = {"_get_parquet_symbol", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_5_get_parquet_symbol, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_4_get_parquet_symbol};
static PyObject *__pyx_pw_7pyarrow_8_dataset_5_get_parquet_symbol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_parquet_symbol (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 95, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 95, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_parquet_symbol", 0) < (0)) __PYX_ERR(0, 95, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_parquet_symbol", 1, 1, 1, i); __PYX_ERR(0, 95, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 95, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_parquet_symbol", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 95, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset._get_parquet_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_4_get_parquet_symbol(__pyx_self, __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_4_get_parquet_symbol(CYTHON_UNUSED PyObject *__pyx_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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_parquet_symbol", 0);

  /* "pyarrow/_dataset.pyx":100
 *     return None.
 *     """
 *     _get_parquet_classes()             # <<<<<<<<<<<<<<
 *     return _dataset_pq and getattr(_dataset_pq, name)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_parquet_classes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":101
 *     """
 *     _get_parquet_classes()
 *     return _dataset_pq and getattr(_dataset_pq, name)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dataset_pq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 101, __pyx_L1_error)
  if (__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dataset_pq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":95
 * 
 * 
 * def _get_parquet_symbol(name):             # <<<<<<<<<<<<<<
 *     """
 *     Get a symbol from pyarrow.parquet if the latter is importable, otherwise
*/

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

/* "pyarrow/_dataset.pyx":104
 * 
 * 
 * cdef CFileSource _make_file_source(object file, FileSystem filesystem=None, object file_size=None):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/

static arrow::dataset::FileSource __pyx_f_7pyarrow_8_dataset__make_file_source(PyObject *__pyx_v_file, struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source *__pyx_optional_args) {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)Py_None);
  PyObject *__pyx_v_file_size = ((PyObject *)Py_None);
  arrow::dataset::FileSource __pyx_v_c_source;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_v_c_filesystem;
  arrow::fs::FileInfo __pyx_v_c_info;
  std::string __pyx_v_c_path;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_c_file;
  std::shared_ptr< arrow::Buffer>  __pyx_v_c_buffer;
  int64_t __pyx_v_c_size;
  arrow::dataset::FileSource __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr< arrow::Buffer>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  std::string __pyx_t_11;
  int64_t __pyx_t_12;
  arrow::fs::FileInfo __pyx_t_13;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_file_source", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_filesystem = __pyx_optional_args->filesystem;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_file_size = __pyx_optional_args->file_size;
      }
    }
  }

  /* "pyarrow/_dataset.pyx":115
 *         int64_t c_size
 * 
 *     if isinstance(file, Buffer):             # <<<<<<<<<<<<<<
 *         c_buffer = pyarrow_unwrap_buffer(file)
 *         c_source = CFileSource(move(c_buffer))
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_file, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Buffer); 
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":116
 * 
 *     if isinstance(file, Buffer):
 *         c_buffer = pyarrow_unwrap_buffer(file)             # <<<<<<<<<<<<<<
 *         c_source = CFileSource(move(c_buffer))
 *     elif _is_path_like(file):
*/
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_v_file); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
    __pyx_v_c_buffer = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

    /* "pyarrow/_dataset.pyx":117
 *     if isinstance(file, Buffer):
 *         c_buffer = pyarrow_unwrap_buffer(file)
 *         c_source = CFileSource(move(c_buffer))             # <<<<<<<<<<<<<<
 *     elif _is_path_like(file):
 *         if filesystem is None:
*/
    __pyx_v_c_source = arrow::dataset::FileSource(cython_std::move<std::shared_ptr< arrow::Buffer> >(__pyx_v_c_buffer));

    /* "pyarrow/_dataset.pyx":115
 *         int64_t c_size
 * 
 *     if isinstance(file, Buffer):             # <<<<<<<<<<<<<<
 *         c_buffer = pyarrow_unwrap_buffer(file)
 *         c_source = CFileSource(move(c_buffer))
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":118
 *         c_buffer = pyarrow_unwrap_buffer(file)
 *         c_source = CFileSource(move(c_buffer))
 *     elif _is_path_like(file):             # <<<<<<<<<<<<<<
 *         if filesystem is None:
 *             raise ValueError("cannot construct a FileSource from "
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_path_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_file};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":119
 *         c_source = CFileSource(move(c_buffer))
 *     elif _is_path_like(file):
 *         if filesystem is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot construct a FileSource from "
 *                              "a path without a FileSystem")
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_filesystem) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "pyarrow/_dataset.pyx":120
 *     elif _is_path_like(file):
 *         if filesystem is None:
 *             raise ValueError("cannot construct a FileSource from "             # <<<<<<<<<<<<<<
 *                              "a path without a FileSystem")
 *         c_filesystem = filesystem.unwrap()
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_cannot_construct_a_FileSource_fr};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __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(0, 120, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":119
 *         c_source = CFileSource(move(c_buffer))
 *     elif _is_path_like(file):
 *         if filesystem is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("cannot construct a FileSource from "
 *                              "a path without a FileSystem")
*/
    }

    /* "pyarrow/_dataset.pyx":122
 *             raise ValueError("cannot construct a FileSource from "
 *                              "a path without a FileSystem")
 *         c_filesystem = filesystem.unwrap()             # <<<<<<<<<<<<<<
 *         c_path = tobytes(_stringify_path(file))
 * 
*/
    __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem->__pyx_vtab)->unwrap(__pyx_v_filesystem); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error)
    __pyx_v_c_filesystem = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_dataset.pyx":123
 *                              "a path without a FileSystem")
 *         c_filesystem = filesystem.unwrap()
 *         c_path = tobytes(_stringify_path(file))             # <<<<<<<<<<<<<<
 * 
 *         if file_size is not None:
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_stringify_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_file};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_path = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

    /* "pyarrow/_dataset.pyx":125
 *         c_path = tobytes(_stringify_path(file))
 * 
 *         if file_size is not None:             # <<<<<<<<<<<<<<
 *             c_size = file_size
 *             c_info = FileInfo(c_path, size=c_size).unwrap()
*/
    __pyx_t_1 = (__pyx_v_file_size != Py_None);
    if (__pyx_t_1) {

      /* "pyarrow/_dataset.pyx":126
 * 
 *         if file_size is not None:
 *             c_size = file_size             # <<<<<<<<<<<<<<
 *             c_info = FileInfo(c_path, size=c_size).unwrap()
 *             c_source = CFileSource(move(c_info), move(c_filesystem))
*/
      __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_v_file_size); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error)
      __pyx_v_c_size = __pyx_t_12;

      /* "pyarrow/_dataset.pyx":127
 *         if file_size is not None:
 *             c_size = file_size
 *             c_info = FileInfo(c_path, size=c_size).unwrap()             # <<<<<<<<<<<<<<
 *             c_source = CFileSource(move(c_info), move(c_filesystem))
 *         else:
*/
      __pyx_t_4 = NULL;
      __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_c_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_c_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_8};
        __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_size, __pyx_t_5, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 127, __pyx_L1_error)
        __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileInfo, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_3);
      }
      __pyx_t_13 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo *)((struct __pyx_obj_7pyarrow_3_fs_FileInfo *)__pyx_t_3)->__pyx_vtab)->unwrap(((struct __pyx_obj_7pyarrow_3_fs_FileInfo *)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_c_info = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13);

      /* "pyarrow/_dataset.pyx":128
 *             c_size = file_size
 *             c_info = FileInfo(c_path, size=c_size).unwrap()
 *             c_source = CFileSource(move(c_info), move(c_filesystem))             # <<<<<<<<<<<<<<
 *         else:
 *             c_source = CFileSource(move(c_path), move(c_filesystem))
*/
      __pyx_v_c_source = arrow::dataset::FileSource(cython_std::move<arrow::fs::FileInfo>(__pyx_v_c_info), cython_std::move<std::shared_ptr<arrow::fs::FileSystem> >(__pyx_v_c_filesystem));

      /* "pyarrow/_dataset.pyx":125
 *         c_path = tobytes(_stringify_path(file))
 * 
 *         if file_size is not None:             # <<<<<<<<<<<<<<
 *             c_size = file_size
 *             c_info = FileInfo(c_path, size=c_size).unwrap()
*/
      goto __pyx_L5;
    }

    /* "pyarrow/_dataset.pyx":130
 *             c_source = CFileSource(move(c_info), move(c_filesystem))
 *         else:
 *             c_source = CFileSource(move(c_path), move(c_filesystem))             # <<<<<<<<<<<<<<
 *     elif hasattr(file, 'read'):
 *         # Optimistically hope this is file-like
*/
    /*else*/ {
      __pyx_v_c_source = arrow::dataset::FileSource(cython_std::move<std::string>(__pyx_v_c_path), cython_std::move<std::shared_ptr<arrow::fs::FileSystem> >(__pyx_v_c_filesystem));
    }
    __pyx_L5:;

    /* "pyarrow/_dataset.pyx":118
 *         c_buffer = pyarrow_unwrap_buffer(file)
 *         c_source = CFileSource(move(c_buffer))
 *     elif _is_path_like(file):             # <<<<<<<<<<<<<<
 *         if filesystem is None:
 *             raise ValueError("cannot construct a FileSource from "
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":131
 *         else:
 *             c_source = CFileSource(move(c_path), move(c_filesystem))
 *     elif hasattr(file, 'read'):             # <<<<<<<<<<<<<<
 *         # Optimistically hope this is file-like
 *         c_file = get_native_file(file, False).get_random_access_file()
*/
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_file, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/_dataset.pyx":133
 *     elif hasattr(file, 'read'):
 *         # Optimistically hope this is file-like
 *         c_file = get_native_file(file, False).get_random_access_file()             # <<<<<<<<<<<<<<
 *         c_source = CFileSource(move(c_file))
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_7pyarrow_3lib_get_native_file(__pyx_v_file, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_3)->__pyx_vtab)->get_random_access_file(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_file = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

    /* "pyarrow/_dataset.pyx":134
 *         # Optimistically hope this is file-like
 *         c_file = get_native_file(file, False).get_random_access_file()
 *         c_source = CFileSource(move(c_file))             # <<<<<<<<<<<<<<
 * 
 *     else:
*/
    __pyx_v_c_source = arrow::dataset::FileSource(cython_std::move<std::shared_ptr< arrow::io::RandomAccessFile> >(__pyx_v_c_file));

    /* "pyarrow/_dataset.pyx":131
 *         else:
 *             c_source = CFileSource(move(c_path), move(c_filesystem))
 *     elif hasattr(file, 'read'):             # <<<<<<<<<<<<<<
 *         # Optimistically hope this is file-like
 *         c_file = get_native_file(file, False).get_random_access_file()
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":137
 * 
 *     else:
 *         raise TypeError("cannot construct a FileSource "             # <<<<<<<<<<<<<<
 *                         "from " + str(file))
 * 
*/
  /*else*/ {
    __pyx_t_10 = NULL;

    /* "pyarrow/_dataset.pyx":138
 *     else:
 *         raise TypeError("cannot construct a FileSource "
 *                         "from " + str(file))             # <<<<<<<<<<<<<<
 * 
 *     return c_source
*/
    __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_v_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_cannot_construct_a_FileSource_fr_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __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(0, 137, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":140
 *                         "from " + str(file))
 * 
 *     return c_source             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_c_source;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":104
 * 
 * 
 * cdef CFileSource _make_file_source(object file, FileSystem filesystem=None, object file_size=None):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow._dataset._make_file_source", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":143
 * 
 * 
 * cdef CSegmentEncoding _get_segment_encoding(str segment_encoding):             # <<<<<<<<<<<<<<
 *     if segment_encoding == "none":
 *         return CSegmentEncoding_None
*/

static  arrow::dataset::SegmentEncoding __pyx_f_7pyarrow_8_dataset__get_segment_encoding(PyObject *__pyx_v_segment_encoding) {
   arrow::dataset::SegmentEncoding __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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_segment_encoding", 0);

  /* "pyarrow/_dataset.pyx":144
 * 
 * cdef CSegmentEncoding _get_segment_encoding(str segment_encoding):
 *     if segment_encoding == "none":             # <<<<<<<<<<<<<<
 *         return CSegmentEncoding_None
 *     elif segment_encoding == "uri":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_segment_encoding, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 144, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":145
 * cdef CSegmentEncoding _get_segment_encoding(str segment_encoding):
 *     if segment_encoding == "none":
 *         return CSegmentEncoding_None             # <<<<<<<<<<<<<<
 *     elif segment_encoding == "uri":
 *         return CSegmentEncoding_Uri
*/
    __pyx_r =  arrow::dataset::SegmentEncoding::None;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":144
 * 
 * cdef CSegmentEncoding _get_segment_encoding(str segment_encoding):
 *     if segment_encoding == "none":             # <<<<<<<<<<<<<<
 *         return CSegmentEncoding_None
 *     elif segment_encoding == "uri":
*/
  }

  /* "pyarrow/_dataset.pyx":146
 *     if segment_encoding == "none":
 *         return CSegmentEncoding_None
 *     elif segment_encoding == "uri":             # <<<<<<<<<<<<<<
 *         return CSegmentEncoding_Uri
 *     raise ValueError(f"Unknown segment encoding: {segment_encoding}")
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_segment_encoding, __pyx_mstate_global->__pyx_n_u_uri, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 146, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":147
 *         return CSegmentEncoding_None
 *     elif segment_encoding == "uri":
 *         return CSegmentEncoding_Uri             # <<<<<<<<<<<<<<
 *     raise ValueError(f"Unknown segment encoding: {segment_encoding}")
 * 
*/
    __pyx_r =  arrow::dataset::SegmentEncoding::Uri;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":146
 *     if segment_encoding == "none":
 *         return CSegmentEncoding_None
 *     elif segment_encoding == "uri":             # <<<<<<<<<<<<<<
 *         return CSegmentEncoding_Uri
 *     raise ValueError(f"Unknown segment encoding: {segment_encoding}")
*/
  }

  /* "pyarrow/_dataset.pyx":148
 *     elif segment_encoding == "uri":
 *         return CSegmentEncoding_Uri
 *     raise ValueError(f"Unknown segment encoding: {segment_encoding}")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_segment_encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_segment_encoding, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __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(0, 148, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":143
 * 
 * 
 * cdef CSegmentEncoding _get_segment_encoding(str segment_encoding):             # <<<<<<<<<<<<<<
 *     if segment_encoding == "none":
 *         return CSegmentEncoding_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._dataset._get_segment_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":151
 * 
 * 
 * cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding):             # <<<<<<<<<<<<<<
 *     if segment_encoding == CSegmentEncoding_None:
 *         return "none"
*/

static PyObject *__pyx_f_7pyarrow_8_dataset__wrap_segment_encoding( arrow::dataset::SegmentEncoding __pyx_v_segment_encoding) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_wrap_segment_encoding", 0);

  /* "pyarrow/_dataset.pyx":152
 * 
 * cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding):
 *     if segment_encoding == CSegmentEncoding_None:             # <<<<<<<<<<<<<<
 *         return "none"
 *     elif segment_encoding == CSegmentEncoding_Uri:
*/
  __pyx_t_1 = (__pyx_v_segment_encoding ==  arrow::dataset::SegmentEncoding::None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":153
 * cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding):
 *     if segment_encoding == CSegmentEncoding_None:
 *         return "none"             # <<<<<<<<<<<<<<
 *     elif segment_encoding == CSegmentEncoding_Uri:
 *         return "uri"
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_none);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_none;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":152
 * 
 * cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding):
 *     if segment_encoding == CSegmentEncoding_None:             # <<<<<<<<<<<<<<
 *         return "none"
 *     elif segment_encoding == CSegmentEncoding_Uri:
*/
  }

  /* "pyarrow/_dataset.pyx":154
 *     if segment_encoding == CSegmentEncoding_None:
 *         return "none"
 *     elif segment_encoding == CSegmentEncoding_Uri:             # <<<<<<<<<<<<<<
 *         return "uri"
 *     raise ValueError("Unknown segment encoding")
*/
  __pyx_t_1 = (__pyx_v_segment_encoding ==  arrow::dataset::SegmentEncoding::Uri);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":155
 *         return "none"
 *     elif segment_encoding == CSegmentEncoding_Uri:
 *         return "uri"             # <<<<<<<<<<<<<<
 *     raise ValueError("Unknown segment encoding")
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_uri);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_uri;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":154
 *     if segment_encoding == CSegmentEncoding_None:
 *         return "none"
 *     elif segment_encoding == CSegmentEncoding_Uri:             # <<<<<<<<<<<<<<
 *         return "uri"
 *     raise ValueError("Unknown segment encoding")
*/
  }

  /* "pyarrow/_dataset.pyx":156
 *     elif segment_encoding == CSegmentEncoding_Uri:
 *         return "uri"
 *     raise ValueError("Unknown segment encoding")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Unknown_segment_encoding_2};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __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(0, 156, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":151
 * 
 * 
 * cdef str _wrap_segment_encoding(CSegmentEncoding segment_encoding):             # <<<<<<<<<<<<<<
 *     if segment_encoding == CSegmentEncoding_None:
 *         return "none"
*/

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

/* "pyarrow/_dataset.pyx":171
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset___init__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_7Dataset___init__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":172
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":171
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":174
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.dataset = sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_7Dataset_init(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":175
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.dataset = sp.get()
 *         self._scan_options = dict()
*/
  __pyx_v_self->wrapped = ((arrow::py::SharedPtrNoGIL<arrow::dataset::Dataset> )__pyx_v_sp);

  /* "pyarrow/_dataset.pyx":176
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         self.wrapped = sp
 *         self.dataset = sp.get()             # <<<<<<<<<<<<<<
 *         self._scan_options = dict()
 * 
*/
  __pyx_v_self->dataset = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":177
 *         self.wrapped = sp
 *         self.dataset = sp.get()
 *         self._scan_options = dict()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_scan_options);
  __Pyx_DECREF(__pyx_v_self->_scan_options);
  __pyx_v_self->_scan_options = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":174
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.dataset = sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/_dataset.pyx":179
 *         self._scan_options = dict()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CDataset]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_7Dataset_wrap(std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":181
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CDataset]& sp):
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":184
 * 
 *         classes = {
 *             'union': UnionDataset,             # <<<<<<<<<<<<<<
 *             'filesystem': FileSystemDataset,
 *             'in-memory': InMemoryDataset,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_union, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset)) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":185
 *         classes = {
 *             'union': UnionDataset,
 *             'filesystem': FileSystemDataset,             # <<<<<<<<<<<<<<
 *             'in-memory': InMemoryDataset,
 *         }
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_filesystem, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset)) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":186
 *             'union': UnionDataset,
 *             'filesystem': FileSystemDataset,
 *             'in-memory': InMemoryDataset,             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_in_memory, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset)) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __pyx_v_classes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":189
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             raise TypeError(type_name)
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_class_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":190
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  __pyx_t_6 = (__pyx_v_class_ == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_dataset.pyx":191
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             raise TypeError(type_name)             # <<<<<<<<<<<<<<
 * 
 *         cdef Dataset self = class_.__new__(class_)
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_type_name};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 191, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":190
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":193
 *             raise TypeError(type_name)
 * 
 *         cdef Dataset self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_3 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_class_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset))))) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":194
 * 
 *         cdef Dataset self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":195
 *         cdef Dataset self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef shared_ptr[CDataset] unwrap(self) nogil:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":179
 *         self._scan_options = dict()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CDataset]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":197
 *         return self
 * 
 *     cdef shared_ptr[CDataset] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static std::shared_ptr<arrow::dataset::Dataset>  __pyx_f_7pyarrow_8_dataset_7Dataset_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_r;

  /* "pyarrow/_dataset.pyx":198
 * 
 *     cdef shared_ptr[CDataset] unwrap(self) nogil:
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":197
 *         return self
 * 
 *     cdef shared_ptr[CDataset] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":200
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_expression(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_20partition_expression_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_20partition_expression_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_20partition_expression___get__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_20partition_expression___get__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":206
 *         Dataset.
 *         """
 *         return Expression.wrap(self.dataset.partition_expression())             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema(self, Schema schema not None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_8_compute_Expression->wrap(__pyx_v_self->dataset->partition_expression()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":200
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_expression(self):
 *         """
*/

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

/* "pyarrow/_dataset.pyx":208
 *         return Expression.wrap(self.dataset.partition_expression())
 * 
 *     def replace_schema(self, Schema schema not None):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this Dataset with a different schema.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_3replace_schema(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_2replace_schema, "Dataset.replace_schema(self, Schema schema)\n\nReturn a copy of this Dataset with a different schema.\n\nThe copy will view the same Fragments. If the new schema is not\ncompatible with the original dataset's schema then an error will\nbe raised.\n\nParameters\n----------\nschema : Schema\n    The new dataset schema.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_3replace_schema = {"replace_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_3replace_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_2replace_schema};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_3replace_schema(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace_schema (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 208, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 208, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace_schema", 0) < (0)) __PYX_ERR(0, 208, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_schema", 1, 1, 1, i); __PYX_ERR(0, 208, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 208, __pyx_L3_error)
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace_schema", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 208, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.replace_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_2replace_schema(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_2replace_schema(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_v_copy;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace_schema", 0);

  /* "pyarrow/_dataset.pyx":222
 *         """
 *         cdef shared_ptr[CDataset] copy = GetResultValue(
 *             self.dataset.ReplaceSchema(pyarrow_unwrap_schema(schema))             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":221
 *             The new dataset schema.
 *         """
 *         cdef shared_ptr[CDataset] copy = GetResultValue(             # <<<<<<<<<<<<<<
 *             self.dataset.ReplaceSchema(pyarrow_unwrap_schema(schema))
 *         )
*/
  __pyx_t_2 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Dataset> >(__pyx_v_self->dataset->ReplaceSchema(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error)
  __pyx_v_copy = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":225
 *         )
 * 
 *         d = Dataset.wrap(move(copy))             # <<<<<<<<<<<<<<
 *         if self._scan_options:
 *             # Preserve scan options if set.
*/
  __pyx_t_3 = __pyx_f_7pyarrow_8_dataset_7Dataset_wrap(cython_std::move<std::shared_ptr<arrow::dataset::Dataset> >(__pyx_v_copy)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_d = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":226
 * 
 *         d = Dataset.wrap(move(copy))
 *         if self._scan_options:             # <<<<<<<<<<<<<<
 *             # Preserve scan options if set.
 *             d._scan_options = self._scan_options.copy()
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_scan_options); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 226, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":228
 *         if self._scan_options:
 *             # Preserve scan options if set.
 *             d._scan_options = self._scan_options.copy()             # <<<<<<<<<<<<<<
 *         return d
 * 
*/
    if (unlikely(__pyx_v_self->_scan_options == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "copy");
      __PYX_ERR(0, 228, __pyx_L1_error)
    }
    __pyx_t_3 = PyDict_Copy(__pyx_v_self->_scan_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_d, __pyx_mstate_global->__pyx_n_u_scan_options, __pyx_t_3) < (0)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":226
 * 
 *         d = Dataset.wrap(move(copy))
 *         if self._scan_options:             # <<<<<<<<<<<<<<
 *             # Preserve scan options if set.
 *             d._scan_options = self._scan_options.copy()
*/
  }

  /* "pyarrow/_dataset.pyx":229
 *             # Preserve scan options if set.
 *             d._scan_options = self._scan_options.copy()
 *         return d             # <<<<<<<<<<<<<<
 * 
 *     def get_fragments(self, Expression filter=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":208
 *         return Expression.wrap(self.dataset.partition_expression())
 * 
 *     def replace_schema(self, Schema schema not None):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this Dataset with a different schema.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.replace_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":231
 *         return d
 * 
 *     def get_fragments(self, Expression filter=None):             # <<<<<<<<<<<<<<
 *         """Returns an iterator over the fragments in this dataset.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_5get_fragments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_4get_fragments, "Dataset.get_fragments(self, Expression filter=None)\n\nReturns an iterator over the fragments in this dataset.\n\nParameters\n----------\nfilter : Expression, default None\n    Return fragments matching the optional filter, either using the\n    partition_expression or internal information like Parquet's\n    statistics.\n\nReturns\n-------\nfragments : iterator of Fragment");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_5get_fragments = {"get_fragments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_5get_fragments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_4get_fragments};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_5get_fragments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fragments (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filter,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 231, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 231, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_fragments", 0) < (0)) __PYX_ERR(0, 231, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 231, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));
    }
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_fragments", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 231, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.get_fragments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 231, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_4get_fragments(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_filter);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_4get_fragments(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fragments", 0);

  /* "pyarrow/_dataset.pyx":245
 *         fragments : iterator of Fragment
 *         """
 *         if self._scan_options.get("filter") is not None:             # <<<<<<<<<<<<<<
 *             # Accessing fragments of a filtered dataset is not supported.
 *             # It would be unclear if you wanted to filter the fragments
*/
  if (unlikely(__pyx_v_self->_scan_options == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 245, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_scan_options, __pyx_mstate_global->__pyx_n_u_filter, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __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;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":249
 *             # It would be unclear if you wanted to filter the fragments
 *             # or the rows in those fragments.
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Retrieving fragments of a filtered or projected "
 *                 "dataset is not allowed. Remove the filtering."
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Retrieving_fragments_of_a_filter};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 249, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":245
 *         fragments : iterator of Fragment
 *         """
 *         if self._scan_options.get("filter") is not None:             # <<<<<<<<<<<<<<
 *             # Accessing fragments of a filtered dataset is not supported.
 *             # It would be unclear if you wanted to filter the fragments
*/
  }

  /* "pyarrow/_dataset.pyx":254
 *             )
 * 
 *         return self._get_fragments(filter)             # <<<<<<<<<<<<<<
 * 
 *     def _get_fragments(self, Expression filter):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_filter)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_fragments, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":231
 *         return d
 * 
 *     def get_fragments(self, Expression filter=None):             # <<<<<<<<<<<<<<
 *         """Returns an iterator over the fragments in this dataset.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.get_fragments", __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_8_dataset_7Dataset_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/_dataset.pyx":256
 *         return self._get_fragments(filter)
 * 
 *     def _get_fragments(self, Expression filter):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExpression c_filter
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_7_get_fragments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_6_get_fragments, "Dataset._get_fragments(self, Expression filter)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_7_get_fragments = {"_get_fragments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_7_get_fragments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_6_get_fragments};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_7_get_fragments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_fragments (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filter,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 256, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_fragments", 0) < (0)) __PYX_ERR(0, 256, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_fragments", 1, 1, 1, i); __PYX_ERR(0, 256, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 256, __pyx_L3_error)
    }
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_fragments", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 256, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset._get_fragments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 256, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_6_get_fragments(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_filter);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_6_get_fragments(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter) {
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_fragments", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct___get_fragments(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 256, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__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_cur_scope->__pyx_v_filter = __pyx_v_filter;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_filter);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_filter);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_8_dataset_7Dataset_8generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_get_fragments, __pyx_mstate_global->__pyx_n_u_Dataset__get_fragments, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset); if (unlikely(!gen)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Dataset._get_fragments", __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_8_dataset_7Dataset_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  arrow::dataset::FragmentIterator __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  arrow::compute::Expression __pyx_t_4;
   arrow::Iterator<std::shared_ptr<arrow::dataset::Fragment> > ::RangeIterator __pyx_t_5;
  arrow::Result<std::shared_ptr<arrow::dataset::Fragment> >  __pyx_t_6;
  std::shared_ptr<arrow::dataset::Fragment>  __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_fragments", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 256, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":260
 *             CExpression c_filter
 * 
 *         if filter is None:             # <<<<<<<<<<<<<<
 *             c_fragments = move(GetResultValue(self.dataset.GetFragments()))
 *         else:
*/
  __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_filter) == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":261
 * 
 *         if filter is None:
 *             c_fragments = move(GetResultValue(self.dataset.GetFragments()))             # <<<<<<<<<<<<<<
 *         else:
 *             c_filter = _bind(filter, self.schema)
*/
    __pyx_t_2 = arrow::py::GetResultValue<arrow::dataset::FragmentIterator>(__pyx_cur_scope->__pyx_v_self->dataset->GetFragments()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_c_fragments = cython_std::move<arrow::dataset::FragmentIterator>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2));

    /* "pyarrow/_dataset.pyx":260
 *             CExpression c_filter
 * 
 *         if filter is None:             # <<<<<<<<<<<<<<
 *             c_fragments = move(GetResultValue(self.dataset.GetFragments()))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":263
 *             c_fragments = move(GetResultValue(self.dataset.GetFragments()))
 *         else:
 *             c_filter = _bind(filter, self.schema)             # <<<<<<<<<<<<<<
 *             c_fragments = move(GetResultValue(
 *                 self.dataset.GetFragments(c_filter)))
*/
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(0, 263, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_7pyarrow_8_compute__bind(__pyx_cur_scope->__pyx_v_filter, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_v_c_filter = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

    /* "pyarrow/_dataset.pyx":264
 *         else:
 *             c_filter = _bind(filter, self.schema)
 *             c_fragments = move(GetResultValue(             # <<<<<<<<<<<<<<
 *                 self.dataset.GetFragments(c_filter)))
 * 
*/
    __pyx_t_2 = arrow::py::GetResultValue<arrow::dataset::FragmentIterator>(__pyx_cur_scope->__pyx_v_self->dataset->GetFragments(__pyx_cur_scope->__pyx_v_c_filter)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_c_fragments = cython_std::move<arrow::dataset::FragmentIterator>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2));
  }
  __pyx_L4:;

  /* "pyarrow/_dataset.pyx":267
 *                 self.dataset.GetFragments(c_filter)))
 * 
 *         for maybe_fragment in c_fragments:             # <<<<<<<<<<<<<<
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))
 * 
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_c_fragments.begin();
  for (; __pyx_t_5 != __pyx_cur_scope->__pyx_v_c_fragments.end(); ++__pyx_t_5) {
    __pyx_t_6 = *__pyx_t_5;
    __pyx_cur_scope->__pyx_v_maybe_fragment = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "pyarrow/_dataset.pyx":268
 * 
 *         for maybe_fragment in c_fragments:
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))             # <<<<<<<<<<<<<<
 * 
 *     def _scanner_options(self, options):
*/
    __pyx_t_7 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Fragment> >(cython_std::move<arrow::Result<std::shared_ptr<arrow::dataset::Fragment> > >(__pyx_cur_scope->__pyx_v_maybe_fragment)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7pyarrow_8_dataset_8Fragment_wrap(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_t_0 = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);
    __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_L7_resume_from_yield:;
    __pyx_t_5 = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_cur_scope->__pyx_t_0);
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 268, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":267
 *                 self.dataset.GetFragments(c_filter)))
 * 
 *         for maybe_fragment in c_fragments:             # <<<<<<<<<<<<<<
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))
 * 
*/
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/_dataset.pyx":256
 *         return self._get_fragments(filter)
 * 
 *     def _get_fragments(self, Expression filter):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExpression c_filter
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("_get_fragments", __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/_dataset.pyx":270
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))
 * 
 *     def _scanner_options(self, options):             # <<<<<<<<<<<<<<
 *         """Returns the default options to create a new Scanner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_10_scanner_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_9_scanner_options, "Dataset._scanner_options(self, options)\n\nReturns the default options to create a new Scanner.\n\nThis is automatically invoked by :meth:`Dataset.scanner`\nand there is no need to use it.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_10_scanner_options = {"_scanner_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_10_scanner_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_9_scanner_options};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_10_scanner_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_scanner_options (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 270, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_scanner_options", 0) < (0)) __PYX_ERR(0, 270, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_scanner_options", 1, 1, 1, i); __PYX_ERR(0, 270, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 270, __pyx_L3_error)
    }
    __pyx_v_options = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_scanner_options", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 270, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset._scanner_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_9_scanner_options(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_options);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_9_scanner_options(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_options) {
  PyObject *__pyx_v_new_options = NULL;
  PyObject *__pyx_v_requested_filter = NULL;
  PyObject *__pyx_v_expressions = NULL;
  PyObject *__pyx_v_current_filter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_scanner_options", 0);

  /* "pyarrow/_dataset.pyx":276
 *         and there is no need to use it.
 *         """
 *         new_options = options.copy()             # <<<<<<<<<<<<<<
 * 
 *         # at the moment only support filter
*/
  __pyx_t_2 = __pyx_v_options;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_new_options = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":279
 * 
 *         # at the moment only support filter
 *         requested_filter = options.get("filter")             # <<<<<<<<<<<<<<
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):
 *             expressions = list(requested_filter.expressions.values())
*/
  __pyx_t_2 = __pyx_v_options;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_filter};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_requested_filter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":280
 *         # at the moment only support filter
 *         requested_filter = options.get("filter")
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):             # <<<<<<<<<<<<<<
 *             expressions = list(requested_filter.expressions.values())
 *             if len(expressions) != 1:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa_substrait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa_substrait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_BoundExpressions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_requested_filter, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":281
 *         requested_filter = options.get("filter")
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):
 *             expressions = list(requested_filter.expressions.values())             # <<<<<<<<<<<<<<
 *             if len(expressions) != 1:
 *                 raise ValueError(
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_requested_filter, __pyx_mstate_global->__pyx_n_u_expressions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_values, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_expressions = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/_dataset.pyx":282
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):
 *             expressions = list(requested_filter.expressions.values())
 *             if len(expressions) != 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Only one BoundExpressions with a single expression are supported")
*/
    __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_expressions); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 282, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_7 != 1);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/_dataset.pyx":283
 *             expressions = list(requested_filter.expressions.values())
 *             if len(expressions) != 1:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "Only one BoundExpressions with a single expression are supported")
 *             new_options["filter"] = requested_filter = expressions[0]
*/
      __pyx_t_2 = NULL;
      __pyx_t_3 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Only_one_BoundExpressions_with_a};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __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(0, 283, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":282
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):
 *             expressions = list(requested_filter.expressions.values())
 *             if len(expressions) != 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Only one BoundExpressions with a single expression are supported")
*/
    }

    /* "pyarrow/_dataset.pyx":285
 *                 raise ValueError(
 *                     "Only one BoundExpressions with a single expression are supported")
 *             new_options["filter"] = requested_filter = expressions[0]             # <<<<<<<<<<<<<<
 * 
 *         current_filter = self._scan_options.get("filter")
*/
    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_expressions, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely((PyObject_SetItem(__pyx_v_new_options, __pyx_mstate_global->__pyx_n_u_filter, __pyx_t_6) < 0))) __PYX_ERR(0, 285, __pyx_L1_error)
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_requested_filter, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/_dataset.pyx":280
 *         # at the moment only support filter
 *         requested_filter = options.get("filter")
 *         if pa_substrait and isinstance(requested_filter, pa_substrait.BoundExpressions):             # <<<<<<<<<<<<<<
 *             expressions = list(requested_filter.expressions.values())
 *             if len(expressions) != 1:
*/
  }

  /* "pyarrow/_dataset.pyx":287
 *             new_options["filter"] = requested_filter = expressions[0]
 * 
 *         current_filter = self._scan_options.get("filter")             # <<<<<<<<<<<<<<
 *         if requested_filter is not None and current_filter is not None:
 *             new_options["filter"] = current_filter & requested_filter
*/
  if (unlikely(__pyx_v_self->_scan_options == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 287, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_scan_options, __pyx_mstate_global->__pyx_n_u_filter, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_current_filter = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/_dataset.pyx":288
 * 
 *         current_filter = self._scan_options.get("filter")
 *         if requested_filter is not None and current_filter is not None:             # <<<<<<<<<<<<<<
 *             new_options["filter"] = current_filter & requested_filter
 *         elif current_filter is not None:
*/
  __pyx_t_5 = (__pyx_v_requested_filter != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_current_filter != Py_None);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":289
 *         current_filter = self._scan_options.get("filter")
 *         if requested_filter is not None and current_filter is not None:
 *             new_options["filter"] = current_filter & requested_filter             # <<<<<<<<<<<<<<
 *         elif current_filter is not None:
 *             new_options["filter"] = current_filter
*/
    __pyx_t_6 = PyNumber_And(__pyx_v_current_filter, __pyx_v_requested_filter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely((PyObject_SetItem(__pyx_v_new_options, __pyx_mstate_global->__pyx_n_u_filter, __pyx_t_6) < 0))) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/_dataset.pyx":288
 * 
 *         current_filter = self._scan_options.get("filter")
 *         if requested_filter is not None and current_filter is not None:             # <<<<<<<<<<<<<<
 *             new_options["filter"] = current_filter & requested_filter
 *         elif current_filter is not None:
*/
    goto __pyx_L7;
  }

  /* "pyarrow/_dataset.pyx":290
 *         if requested_filter is not None and current_filter is not None:
 *             new_options["filter"] = current_filter & requested_filter
 *         elif current_filter is not None:             # <<<<<<<<<<<<<<
 *             new_options["filter"] = current_filter
 * 
*/
  __pyx_t_4 = (__pyx_v_current_filter != Py_None);
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":291
 *             new_options["filter"] = current_filter & requested_filter
 *         elif current_filter is not None:
 *             new_options["filter"] = current_filter             # <<<<<<<<<<<<<<
 * 
 *         return new_options
*/
    if (unlikely((PyObject_SetItem(__pyx_v_new_options, __pyx_mstate_global->__pyx_n_u_filter, __pyx_v_current_filter) < 0))) __PYX_ERR(0, 291, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":290
 *         if requested_filter is not None and current_filter is not None:
 *             new_options["filter"] = current_filter & requested_filter
 *         elif current_filter is not None:             # <<<<<<<<<<<<<<
 *             new_options["filter"] = current_filter
 * 
*/
  }
  __pyx_L7:;

  /* "pyarrow/_dataset.pyx":293
 *             new_options["filter"] = current_filter
 * 
 *         return new_options             # <<<<<<<<<<<<<<
 * 
 *     def scanner(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_new_options);
  __pyx_r = __pyx_v_new_options;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":270
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))
 * 
 *     def _scanner_options(self, options):             # <<<<<<<<<<<<<<
 *         """Returns the default options to create a new Scanner.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset._scanner_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_options);
  __Pyx_XDECREF(__pyx_v_requested_filter);
  __Pyx_XDECREF(__pyx_v_expressions);
  __Pyx_XDECREF(__pyx_v_current_filter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":295
 *         return new_options
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 object filter=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_12scanner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_11scanner, "Dataset.scanner(self, columns=None, filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nBuild a scan operation against the dataset.\n\nData is not loaded immediately. Instead, this produces a Scanner,\nwhich exposes further operations (e.g. loading all data as a\ntable, counting rows).\n\nSee the :meth:`Scanner.from_dataset` method for further information.\n\nParameters\n----------\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row"" count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nscanner : Scanner\n\nExamples\n--------\n>>> import pyarrow as pa\n>>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],\n...                   'n_legs': [2, 2, 4, 4, 5, 100],\n...                   'animal': [\"Flamingo\", \"Parrot\", \"Dog\", \"Horse\",\n...                              \"Brittle stars\", \"Centipede\"]})\n>>>\n>>> import pyarrow.parquet as pq\n>>> pq.write_table(table, \"dataset_scanner.parquet\")\n\n>>> import pyarrow.dataset as ds\n>>> dataset = ds.dataset(\"dataset_scanner.parquet\")\n\nSelecting a subset of the columns:\n\n>>> dataset.scanner(columns=[\"year\", \"n_legs\"]).to_table()\npyarrow.Table\nyear: int64\nn_legs: int64\n----\nyear: [[2020,2022,2021,2022,2019,2021]]\nn_legs: [[2,2,4,4,5,100]]\n\nProjecting selected columns using an expression:\n\n>>> dataset.scanner(columns={\n...     \"n_legs_uint""\": ds.field(\"n_legs\").cast(\"uint8\"),\n... }).to_table()\npyarrow.Table\nn_legs_uint: uint8\n----\nn_legs_uint: [[2,2,4,4,5,100]]\n\nFiltering rows while scanning:\n\n>>> dataset.scanner(filter=ds.field(\"year\") > 2020).to_table()\npyarrow.Table\nyear: int64\nn_legs: int64\nanimal: string\n----\nyear: [[2022,2021,2022,2021]]\nn_legs: [[2,4,4,100]]\nanimal: [[\"Parrot\",\"Dog\",\"Horse\",\"Centipede\"]]");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_12scanner = {"scanner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_12scanner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_11scanner};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_12scanner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scanner (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 295, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scanner", 0) < (0)) __PYX_ERR(0, 295, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":296
 * 
 *     def scanner(self,
 *                 object columns=None,             # <<<<<<<<<<<<<<
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":297
 *     def scanner(self,
 *                 object columns=None,
 *                 object filter=None,             # <<<<<<<<<<<<<<
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":301
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":304
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Build a scan operation against the dataset.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":296
 * 
 *     def scanner(self,
 *                 object columns=None,             # <<<<<<<<<<<<<<
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":297
 *     def scanner(self,
 *                 object columns=None,
 *                 object filter=None,             # <<<<<<<<<<<<<<
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":301
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":304
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Build a scan operation against the dataset.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_columns = values[0];
    __pyx_v_filter = values[1];
    if (values[2]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__2;
    }
    if (values[3]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__3;
    }
    if (values[4]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__4;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[5]);
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":302
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,             # <<<<<<<<<<<<<<
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[7]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":303
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                 MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[8]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scanner", 0, 0, 9, __pyx_nargs); __PYX_ERR(0, 295, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.scanner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 301, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_11scanner(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":295
 *         return new_options
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 object filter=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_11scanner(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scanner", 0);

  /* "pyarrow/_dataset.pyx":415
 *         animal: [["Parrot","Dog","Horse","Centipede"]]
 *         """
 *         return Scanner.from_dataset(             # <<<<<<<<<<<<<<
 *             self,
 *             columns=columns,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":419
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":420
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":421
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":423
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":424
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         )
*/
  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":425
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_9, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, __pyx_v_filter, __pyx_t_9, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_3, __pyx_t_9, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_4, __pyx_t_9, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_5, __pyx_t_9, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_9, __pyx_callargs+2, 5) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_6, __pyx_t_9, __pyx_callargs+2, 6) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 7) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_9, __pyx_callargs+2, 8) < (0)) __PYX_ERR(0, 415, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_dataset, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":295
 *         return new_options
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 object filter=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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.scanner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":428
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_14to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_13to_batches, "Dataset.to_batches(self, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nRead the dataset as materialized record batches.\n\nParameters\n----------\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches"" to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nrecord_batches : iterator of RecordBatch");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_14to_batches = {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_14to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_13to_batches};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_14to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 428, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_batches", 0) < (0)) __PYX_ERR(0, 428, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":429
 * 
 *     def to_batches(self,
 *                    object columns=None,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":430
 *     def to_batches(self,
 *                    object columns=None,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":434
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":437
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the dataset as materialized record batches.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":429
 * 
 *     def to_batches(self,
 *                    object columns=None,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":430
 *     def to_batches(self,
 *                    object columns=None,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":434
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":437
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the dataset as materialized record batches.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_columns = values[0];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[1]);
    if (values[2]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__5;
    }
    if (values[3]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__6;
    }
    if (values[4]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__7;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[5]);
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":435
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,             # <<<<<<<<<<<<<<
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[7]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":436
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                    MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[8]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_batches", 0, 0, 9, __pyx_nargs); __PYX_ERR(0, 428, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 430, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 434, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 437, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_13to_batches(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":428
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_13to_batches(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_batches", 0);

  /* "pyarrow/_dataset.pyx":496
 *         record_batches : iterator of RecordBatch
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":506
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).to_batches()             # <<<<<<<<<<<<<<
 * 
 *     def to_table(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":499
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":500
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":501
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":503
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":504
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).to_batches()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":505
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).to_batches()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 496, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_batches, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":428
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":508
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_16to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_15to_table, "Dataset.to_table(self, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nRead the dataset to an Arrow table.\n\nNote that this method reads all the selected data from the dataset\ninto memory.\n\nParameters\n----------\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce thei""r size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ntable : Table");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_16to_table = {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_16to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_15to_table};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_16to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 508, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_table", 0) < (0)) __PYX_ERR(0, 508, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":509
 * 
 *     def to_table(self,
 *                  object columns=None,             # <<<<<<<<<<<<<<
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":510
 *     def to_table(self,
 *                  object columns=None,
 *                  Expression filter=None,             # <<<<<<<<<<<<<<
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":514
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":517
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the dataset to an Arrow table.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":509
 * 
 *     def to_table(self,
 *                  object columns=None,             # <<<<<<<<<<<<<<
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":510
 *     def to_table(self,
 *                  object columns=None,
 *                  Expression filter=None,             # <<<<<<<<<<<<<<
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":514
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":517
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the dataset to an Arrow table.
*/
      if (!values[8]) values[8] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_columns = values[0];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[1]);
    if (values[2]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__8;
    }
    if (values[3]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__9;
    }
    if (values[4]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__10;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[5]);
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":515
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,             # <<<<<<<<<<<<<<
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[7]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":516
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[8]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_table", 0, 0, 9, __pyx_nargs); __PYX_ERR(0, 508, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.to_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 514, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 517, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_15to_table(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":508
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_15to_table(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_table", 0);

  /* "pyarrow/_dataset.pyx":579
 *         table : Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":589
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).to_table()             # <<<<<<<<<<<<<<
 * 
 *     def take(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":582
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":583
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":584
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":586
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":587
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).to_table()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":588
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).to_table()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 579, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_table, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":508
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.to_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":591
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_18take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_17take, "Dataset.take(self, indices, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nSelect rows of data by index.\n\nParameters\n----------\nindices : Array or array-like\n    indices of rows to select in the dataset.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.""\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ntable : Table");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_18take = {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_18take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_17take};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_18take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 591, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "take", 0) < (0)) __PYX_ERR(0, 591, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":593
 *     def take(self,
 *              object indices,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":594
 *              object indices,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":598
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":601
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("take", 0, 1, 10, i); __PYX_ERR(0, 591, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 591, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":593
 *     def take(self,
 *              object indices,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":594
 *              object indices,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":598
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":601
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_indices = values[0];
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__11;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__12;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__13;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":599
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,             # <<<<<<<<<<<<<<
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":600
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
 *              bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *              MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 591, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 601, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_17take(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_indices, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":591
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_17take(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take", 0);

  /* "pyarrow/_dataset.pyx":662
 *         table : Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":672
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).take(indices)             # <<<<<<<<<<<<<<
 * 
 *     def head(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":665
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":666
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":667
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":669
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":670
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).take(indices)
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":671
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).take(indices)
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 662, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":672
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).take(indices)             # <<<<<<<<<<<<<<
 * 
 *     def head(self,
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":591
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":674
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_20head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_19head, "Dataset.head(self, int num_rows, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nLoad the first N rows of the dataset.\n\nParameters\n----------\nnum_rows : int\n    The number of rows to load.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahea""d : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ntable : Table");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_20head = {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_20head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_19head};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_20head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num_rows;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("head (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_num_rows,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 674, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "head", 0) < (0)) __PYX_ERR(0, 674, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":676
 *     def head(self,
 *              int num_rows,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":677
 *              int num_rows,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":681
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":684
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the dataset.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("head", 0, 1, 10, i); __PYX_ERR(0, 674, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 674, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":676
 *     def head(self,
 *              int num_rows,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":677
 *              int num_rows,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":681
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":684
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the dataset.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_num_rows = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_num_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L3_error)
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__14;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__15;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__16;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":682
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,             # <<<<<<<<<<<<<<
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":683
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
 *              bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *              MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("head", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 674, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 677, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 681, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 684, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_19head(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_num_rows, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":674
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_19head(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, int __pyx_v_num_rows, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("head", 0);

  /* "pyarrow/_dataset.pyx":745
 *         table : Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":755
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).head(num_rows)             # <<<<<<<<<<<<<<
 * 
 *     def count_rows(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":748
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":749
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":750
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":752
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":753
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).head(num_rows)
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":754
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).head(num_rows)
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 745, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":755
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).head(num_rows)             # <<<<<<<<<<<<<<
 * 
 *     def count_rows(self,
*/
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_num_rows); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_head, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":674
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":757
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_22count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_21count_rows, "Dataset.count_rows(self, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nCount rows matching the scanner filter.\n\nParameters\n----------\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ncount : int");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_22count_rows = {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_22count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_21count_rows};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_22count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count_rows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 757, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "count_rows", 0) < (0)) __PYX_ERR(0, 757, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":758
 * 
 *     def count_rows(self,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":762
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":765
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":758
 * 
 *     def count_rows(self,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":762
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":765
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[0]);
    if (values[1]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__17;
    }
    if (values[2]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__18;
    }
    if (values[3]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__19;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[4]);
    if (values[5]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 763, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":763
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,             # <<<<<<<<<<<<<<
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[6]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 764, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":764
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                    MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[7]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count_rows", 0, 0, 8, __pyx_nargs); __PYX_ERR(0, 757, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.count_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 758, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 762, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 765, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_21count_rows(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":757
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_21count_rows(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count_rows", 0);

  /* "pyarrow/_dataset.pyx":805
 *         count : int
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             filter=filter,
 *             batch_size=batch_size,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":814
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).count_rows()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":807
 *         return self.scanner(
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":808
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":809
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":811
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":812
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).count_rows()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":813
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).count_rows()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 8 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 805, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_count_rows, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":757
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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_11);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.count_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":816
 *         ).count_rows()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The common schema of the full Dataset"""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_6schema_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_6schema___get__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_6schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":819
 *     def schema(self):
 *         """The common schema of the full Dataset"""
 *         return pyarrow_wrap_schema(self.dataset.schema())             # <<<<<<<<<<<<<<
 * 
 *     def filter(self, expression not None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->dataset->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":816
 *         ).count_rows()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The common schema of the full Dataset"""
*/

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

/* "pyarrow/_dataset.pyx":821
 *         return pyarrow_wrap_schema(self.dataset.schema())
 * 
 *     def filter(self, expression not None):             # <<<<<<<<<<<<<<
 *         """
 *         Apply a row filter to the dataset.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_24filter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_23filter, "Dataset.filter(self, expression)\n\nApply a row filter to the dataset.\n\nParameters\n----------\nexpression : Expression\n    The filter that should be applied to the dataset.\n\nReturns\n-------\nDataset");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_24filter = {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_24filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_23filter};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_24filter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_expression = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("filter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_expression,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "filter", 0) < (0)) __PYX_ERR(0, 821, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("filter", 1, 1, 1, i); __PYX_ERR(0, 821, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 821, __pyx_L3_error)
    }
    __pyx_v_expression = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(((PyObject *)__pyx_v_expression) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "expression"); __PYX_ERR(0, 821, __pyx_L1_error)
  }
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_23filter(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_expression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_23filter(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_expression) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_filtered_dataset = 0;
  PyObject *__pyx_v_new_filter = NULL;
  PyObject *__pyx_v_current_filter = 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("filter", 0);

  /* "pyarrow/_dataset.pyx":837
 *             Dataset filtered_dataset
 * 
 *         new_filter = expression             # <<<<<<<<<<<<<<
 *         current_filter = self._scan_options.get("filter")
 *         if current_filter is not None and new_filter is not None:
*/
  __Pyx_INCREF(__pyx_v_expression);
  __pyx_v_new_filter = __pyx_v_expression;

  /* "pyarrow/_dataset.pyx":838
 * 
 *         new_filter = expression
 *         current_filter = self._scan_options.get("filter")             # <<<<<<<<<<<<<<
 *         if current_filter is not None and new_filter is not None:
 *             new_filter = current_filter & new_filter
*/
  if (unlikely(__pyx_v_self->_scan_options == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 838, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_scan_options, __pyx_mstate_global->__pyx_n_u_filter, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_current_filter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":839
 *         new_filter = expression
 *         current_filter = self._scan_options.get("filter")
 *         if current_filter is not None and new_filter is not None:             # <<<<<<<<<<<<<<
 *             new_filter = current_filter & new_filter
 * 
*/
  __pyx_t_3 = (__pyx_v_current_filter != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_new_filter != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":840
 *         current_filter = self._scan_options.get("filter")
 *         if current_filter is not None and new_filter is not None:
 *             new_filter = current_filter & new_filter             # <<<<<<<<<<<<<<
 * 
 *         filtered_dataset = self.__class__.__new__(self.__class__)
*/
    __pyx_t_1 = PyNumber_And(__pyx_v_current_filter, __pyx_v_new_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_new_filter, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":839
 *         new_filter = expression
 *         current_filter = self._scan_options.get("filter")
 *         if current_filter is not None and new_filter is not None:             # <<<<<<<<<<<<<<
 *             new_filter = current_filter & new_filter
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":842
 *             new_filter = current_filter & new_filter
 * 
 *         filtered_dataset = self.__class__.__new__(self.__class__)             # <<<<<<<<<<<<<<
 *         filtered_dataset.init(self.wrapped)
 *         filtered_dataset._scan_options = dict(filter=new_filter)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset))))) __PYX_ERR(0, 842, __pyx_L1_error)
  __pyx_v_filtered_dataset = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":843
 * 
 *         filtered_dataset = self.__class__.__new__(self.__class__)
 *         filtered_dataset.init(self.wrapped)             # <<<<<<<<<<<<<<
 *         filtered_dataset._scan_options = dict(filter=new_filter)
 *         return filtered_dataset
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *)__pyx_v_filtered_dataset->__pyx_vtab)->init(__pyx_v_filtered_dataset, __pyx_v_self->wrapped); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 843, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":844
 *         filtered_dataset = self.__class__.__new__(self.__class__)
 *         filtered_dataset.init(self.wrapped)
 *         filtered_dataset._scan_options = dict(filter=new_filter)             # <<<<<<<<<<<<<<
 *         return filtered_dataset
 * 
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_filter, __pyx_v_new_filter) < (0)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_filtered_dataset->_scan_options);
  __Pyx_DECREF(__pyx_v_filtered_dataset->_scan_options);
  __pyx_v_filtered_dataset->_scan_options = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":845
 *         filtered_dataset.init(self.wrapped)
 *         filtered_dataset._scan_options = dict(filter=new_filter)
 *         return filtered_dataset             # <<<<<<<<<<<<<<
 * 
 *     def sort_by(self, sorting, **kwargs):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_filtered_dataset);
  __pyx_r = ((PyObject *)__pyx_v_filtered_dataset);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":821
 *         return pyarrow_wrap_schema(self.dataset.schema())
 * 
 *     def filter(self, expression not None):             # <<<<<<<<<<<<<<
 *         """
 *         Apply a row filter to the dataset.
*/

  /* 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._dataset.Dataset.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_filtered_dataset);
  __Pyx_XDECREF(__pyx_v_new_filter);
  __Pyx_XDECREF(__pyx_v_current_filter);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":847
 *         return filtered_dataset
 * 
 *     def sort_by(self, sorting, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Sort the Dataset by one or multiple columns.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_26sort_by(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_25sort_by, "Dataset.sort_by(self, sorting, **kwargs)\n\nSort the Dataset by one or multiple columns.\n\nParameters\n----------\nsorting : str or list[tuple(name, order)]\n    Name of the column to use to sort (ascending), or\n    a list of multiple sorting conditions where\n    each entry is a tuple with column name\n    and sorting order (\"ascending\" or \"descending\")\n**kwargs : dict, optional\n    Additional sorting options.\n    As allowed by :class:`SortOptions`\n\nReturns\n-------\nInMemoryDataset\n    A new dataset sorted according to the sort keys.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_26sort_by = {"sort_by", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_26sort_by, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_25sort_by};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_26sort_by(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sorting = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sort_by (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sorting,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 847, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "sort_by", 1) < (0)) __PYX_ERR(0, 847, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sort_by", 1, 1, 1, i); __PYX_ERR(0, 847, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 847, __pyx_L3_error)
    }
    __pyx_v_sorting = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sort_by", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 847, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.sort_by", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_25sort_by(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_sorting, __pyx_v_kwargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_25sort_by(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_sorting, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_res = 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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sort_by", 0);
  __Pyx_INCREF(__pyx_v_sorting);

  /* "pyarrow/_dataset.pyx":867
 *             A new dataset sorted according to the sort keys.
 *         """
 *         if isinstance(sorting, str):             # <<<<<<<<<<<<<<
 *             sorting = [(sorting, "ascending")]
 * 
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_sorting); 
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":868
 *         """
 *         if isinstance(sorting, str):
 *             sorting = [(sorting, "ascending")]             # <<<<<<<<<<<<<<
 * 
 *         res = _pac()._sort_source(
*/
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_sorting);
    __Pyx_GIVEREF(__pyx_v_sorting);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorting) != (0)) __PYX_ERR(0, 868, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_ascending);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_ascending);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_n_u_ascending) != (0)) __PYX_ERR(0, 868, __pyx_L1_error);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 868, __pyx_L1_error);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_sorting, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":867
 *             A new dataset sorted according to the sort keys.
 *         """
 *         if isinstance(sorting, str):             # <<<<<<<<<<<<<<
 *             sorting = [(sorting, "ascending")]
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":870
 *             sorting = [(sorting, "ascending")]
 * 
 *         res = _pac()._sort_source(             # <<<<<<<<<<<<<<
 *             self, output_type=InMemoryDataset, sort_keys=sorting, **kwargs
 *         )
*/
  __pyx_t_2 = NULL;
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pac); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sort_source); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":871
 * 
 *         res = _pac()._sort_source(
 *             self, output_type=InMemoryDataset, sort_keys=sorting, **kwargs             # <<<<<<<<<<<<<<
 *         )
 *         return res
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_output_type, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset)) < (0)) __PYX_ERR(0, 871, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sort_keys, __pyx_v_sorting) < (0)) __PYX_ERR(0, 871, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_t_5 = 0;
  if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_kwargs) < (0)) __PYX_ERR(0, 871, __pyx_L1_error)
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":873
 *             self, output_type=InMemoryDataset, sort_keys=sorting, **kwargs
 *         )
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":847
 *         return filtered_dataset
 * 
 *     def sort_by(self, sorting, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Sort the Dataset by one or multiple columns.
*/

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

/* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_28join(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_27join, "Dataset.join(self, right_dataset, keys, right_keys=None, join_type='left outer', left_suffix=None, right_suffix=None, coalesce_keys=True, use_threads=True)\n\nPerform a join between this dataset and another one.\n\nResult of the join will be a new dataset, where further\noperations can be applied.\n\nParameters\n----------\nright_dataset : dataset\n    The dataset to join to the current one, acting as the right dataset\n    in the join operation.\nkeys : str or list[str]\n    The columns from current dataset that should be used as keys\n    of the join operation left side.\nright_keys : str or list[str], default None\n    The columns from the right_dataset that should be used as keys\n    on the join operation right side.\n    When ``None`` use the same key names as the left dataset.\njoin_type : str, default \"left outer\"\n    The kind of join that should be performed, one of\n    (\"left semi\", \"right semi\", \"left anti\", \"right anti\",\n    \"inner\", \"left outer\", \"right outer\", \"full outer\")\nleft_suffix : str, default None\n    Which suffix to add to right column names. This prevents confusion\n    when the columns in left and right datasets have colliding names.\nright_suffix : str, default None\n    Which suffix to add to the left column names. This prevents confusion\n    when the columns in left and right datasets have colliding names.\ncoalesce_keys : bool, default True\n    If the duplicated keys should be omitted from one of the sides\n    in the join result.\nuse_threads : bool, default True\n    Whenever to use multithreading or not.\n\nReturns\n-------\nInMemoryDataset");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_28join = {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_28join, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_27join};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_28join(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_right_dataset = 0;
  PyObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_right_keys = 0;
  PyObject *__pyx_v_join_type = 0;
  PyObject *__pyx_v_left_suffix = 0;
  PyObject *__pyx_v_right_suffix = 0;
  PyObject *__pyx_v_coalesce_keys = 0;
  PyObject *__pyx_v_use_threads = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_right_dataset,&__pyx_mstate_global->__pyx_n_u_keys,&__pyx_mstate_global->__pyx_n_u_right_keys,&__pyx_mstate_global->__pyx_n_u_join_type,&__pyx_mstate_global->__pyx_n_u_left_suffix,&__pyx_mstate_global->__pyx_n_u_right_suffix,&__pyx_mstate_global->__pyx_n_u_coalesce_keys,&__pyx_mstate_global->__pyx_n_u_use_threads,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 875, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "join", 0) < (0)) __PYX_ERR(0, 875, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u_left_outer));

      /* "pyarrow/_dataset.pyx":876
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,             # <<<<<<<<<<<<<<
 *              use_threads=True):
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "pyarrow/_dataset.pyx":877
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):             # <<<<<<<<<<<<<<
 *         """
 *         Perform a join between this dataset and another one.
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("join", 0, 2, 8, i); __PYX_ERR(0, 875, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u_left_outer));

      /* "pyarrow/_dataset.pyx":876
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,             # <<<<<<<<<<<<<<
 *              use_threads=True):
 *         """
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "pyarrow/_dataset.pyx":877
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):             # <<<<<<<<<<<<<<
 *         """
 *         Perform a join between this dataset and another one.
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_right_dataset = values[0];
    __pyx_v_keys = values[1];
    __pyx_v_right_keys = values[2];
    __pyx_v_join_type = values[3];
    __pyx_v_left_suffix = values[4];
    __pyx_v_right_suffix = values[5];
    __pyx_v_coalesce_keys = values[6];
    __pyx_v_use_threads = values[7];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join", 0, 2, 8, __pyx_nargs); __PYX_ERR(0, 875, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_27join(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_right_dataset, __pyx_v_keys, __pyx_v_right_keys, __pyx_v_join_type, __pyx_v_left_suffix, __pyx_v_right_suffix, __pyx_v_coalesce_keys, __pyx_v_use_threads);

  /* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_27join(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_right_dataset, PyObject *__pyx_v_keys, PyObject *__pyx_v_right_keys, PyObject *__pyx_v_join_type, PyObject *__pyx_v_left_suffix, PyObject *__pyx_v_right_suffix, PyObject *__pyx_v_coalesce_keys, PyObject *__pyx_v_use_threads) {
  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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("join", 0);
  __Pyx_INCREF(__pyx_v_right_keys);

  /* "pyarrow/_dataset.pyx":916
 *         InMemoryDataset
 *         """
 *         if right_keys is None:             # <<<<<<<<<<<<<<
 *             right_keys = keys
 *         return _pac()._perform_join(
*/
  __pyx_t_1 = (__pyx_v_right_keys == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":917
 *         """
 *         if right_keys is None:
 *             right_keys = keys             # <<<<<<<<<<<<<<
 *         return _pac()._perform_join(
 *             join_type, self, keys, right_dataset, right_keys,
*/
    __Pyx_INCREF(__pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_v_right_keys, __pyx_v_keys);

    /* "pyarrow/_dataset.pyx":916
 *         InMemoryDataset
 *         """
 *         if right_keys is None:             # <<<<<<<<<<<<<<
 *             right_keys = keys
 *         return _pac()._perform_join(
*/
  }

  /* "pyarrow/_dataset.pyx":918
 *         if right_keys is None:
 *             right_keys = keys
 *         return _pac()._perform_join(             # <<<<<<<<<<<<<<
 *             join_type, self, keys, right_dataset, right_keys,
 *             left_suffix=left_suffix, right_suffix=right_suffix,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pac); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":922
 *             left_suffix=left_suffix, right_suffix=right_suffix,
 *             use_threads=use_threads, coalesce_keys=coalesce_keys,
 *             output_type=InMemoryDataset             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[6 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_3, __pyx_v_join_type, ((PyObject *)__pyx_v_self), __pyx_v_keys, __pyx_v_right_dataset, __pyx_v_right_keys};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_left_suffix, __pyx_v_left_suffix, __pyx_t_6, __pyx_callargs+6, 0) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_right_suffix, __pyx_v_right_suffix, __pyx_t_6, __pyx_callargs+6, 1) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_v_use_threads, __pyx_t_6, __pyx_callargs+6, 2) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_coalesce_keys, __pyx_v_coalesce_keys, __pyx_t_6, __pyx_callargs+6, 3) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_type, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset), __pyx_t_6, __pyx_callargs+6, 4) < (0)) __PYX_ERR(0, 918, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_perform_join, __pyx_callargs+__pyx_t_7, (6-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              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_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_right_keys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":925
 *         )
 * 
 *     def join_asof(self, right_dataset, on, by, tolerance, right_on=None, right_by=None):             # <<<<<<<<<<<<<<
 *         """
 *         Perform an asof join between this dataset and another one.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_30join_asof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_29join_asof, "Dataset.join_asof(self, right_dataset, on, by, tolerance, right_on=None, right_by=None)\n\nPerform an asof join between this dataset and another one.\n\nThis is similar to a left-join except that we match on nearest key rather\nthan equal keys. Both datasets must be sorted by the key. This type of join\nis most useful for time series data that are not perfectly aligned.\n\nOptionally match on equivalent keys with \"by\" before searching with \"on\".\n\nResult of the join will be a new Dataset, where further\noperations can be applied.\n\nParameters\n----------\nright_dataset : dataset\n    The dataset to join to the current one, acting as the right dataset\n    in the join operation.\non : str\n    The column from current dataset that should be used as the \"on\" key\n    of the join operation left side.\n\n    An inexact match is used on the \"on\" key, i.e. a row is considered a\n    match if and only if ``right.on - left.on`` is in the range\n    ``[min(0, tolerance), max(0, tolerance)]``.\n\n    The input table must be sorted by the \"on\" key. Must be a single\n    field of a common type.\n\n    Currently, the \"on\" key must be an integer, date, or timestamp type.\nby : str or list[str]\n    The columns from current dataset that should be used as the keys\n    of the join operation left side. The join operation is then done\n    only for the matches in these columns.\ntolerance : int\n    The tolerance for inexact \"on\" key matching. A right row is considered\n    a match with a left row if ``right.on - left.on`` is in the range\n    ``[min(0, tolerance), max(0, tolerance)]``. ``tolerance`` may be:\n\n    - negative, in which case a past-as-of-join occurs\n      (match iff ``tolerance <= right.on - left.on <= 0``);\n    - or positive, in which case a future-as-of-join occurs\n      (match iff ``0 <= right.on - left.on <= tolerance``);\n    - or zero, in which case an exact-as-of-join occurs\n      (match iff ``right.on == left.on``).\n\n    The tolerance is i""nterpreted in the same units as the \"on\" key.\nright_on : str or list[str], default None\n    The columns from the right_dataset that should be used as the on key\n    on the join operation right side.\n    When ``None`` use the same key name as the left dataset.\nright_by : str or list[str], default None\n    The columns from the right_dataset that should be used as by keys\n    on the join operation right side.\n    When ``None`` use the same key names as the left dataset.\n\nReturns\n-------\nInMemoryDataset");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_30join_asof = {"join_asof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_30join_asof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_29join_asof};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_30join_asof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_right_dataset = 0;
  PyObject *__pyx_v_on = 0;
  PyObject *__pyx_v_by = 0;
  PyObject *__pyx_v_tolerance = 0;
  PyObject *__pyx_v_right_on = 0;
  PyObject *__pyx_v_right_by = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join_asof (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_right_dataset,&__pyx_mstate_global->__pyx_n_u_on,&__pyx_mstate_global->__pyx_n_u_by,&__pyx_mstate_global->__pyx_n_u_tolerance,&__pyx_mstate_global->__pyx_n_u_right_on,&__pyx_mstate_global->__pyx_n_u_right_by,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 925, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "join_asof", 0) < (0)) __PYX_ERR(0, 925, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("join_asof", 0, 4, 6, i); __PYX_ERR(0, 925, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 925, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 925, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 925, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 925, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_right_dataset = values[0];
    __pyx_v_on = values[1];
    __pyx_v_by = values[2];
    __pyx_v_tolerance = values[3];
    __pyx_v_right_on = values[4];
    __pyx_v_right_by = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join_asof", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 925, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.join_asof", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_29join_asof(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_right_dataset, __pyx_v_on, __pyx_v_by, __pyx_v_tolerance, __pyx_v_right_on, __pyx_v_right_by);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_29join_asof(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_right_dataset, PyObject *__pyx_v_on, PyObject *__pyx_v_by, PyObject *__pyx_v_tolerance, PyObject *__pyx_v_right_on, PyObject *__pyx_v_right_by) {
  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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("join_asof", 0);
  __Pyx_INCREF(__pyx_v_right_on);
  __Pyx_INCREF(__pyx_v_right_by);

  /* "pyarrow/_dataset.pyx":985
 *         InMemoryDataset
 *         """
 *         if right_on is None:             # <<<<<<<<<<<<<<
 *             right_on = on
 *         if right_by is None:
*/
  __pyx_t_1 = (__pyx_v_right_on == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":986
 *         """
 *         if right_on is None:
 *             right_on = on             # <<<<<<<<<<<<<<
 *         if right_by is None:
 *             right_by = by
*/
    __Pyx_INCREF(__pyx_v_on);
    __Pyx_DECREF_SET(__pyx_v_right_on, __pyx_v_on);

    /* "pyarrow/_dataset.pyx":985
 *         InMemoryDataset
 *         """
 *         if right_on is None:             # <<<<<<<<<<<<<<
 *             right_on = on
 *         if right_by is None:
*/
  }

  /* "pyarrow/_dataset.pyx":987
 *         if right_on is None:
 *             right_on = on
 *         if right_by is None:             # <<<<<<<<<<<<<<
 *             right_by = by
 *         return _pac()._perform_join_asof(self, on, by,
*/
  __pyx_t_1 = (__pyx_v_right_by == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":988
 *             right_on = on
 *         if right_by is None:
 *             right_by = by             # <<<<<<<<<<<<<<
 *         return _pac()._perform_join_asof(self, on, by,
 *                                          right_dataset, right_on, right_by,
*/
    __Pyx_INCREF(__pyx_v_by);
    __Pyx_DECREF_SET(__pyx_v_right_by, __pyx_v_by);

    /* "pyarrow/_dataset.pyx":987
 *         if right_on is None:
 *             right_on = on
 *         if right_by is None:             # <<<<<<<<<<<<<<
 *             right_by = by
 *         return _pac()._perform_join_asof(self, on, by,
*/
  }

  /* "pyarrow/_dataset.pyx":989
 *         if right_by is None:
 *             right_by = by
 *         return _pac()._perform_join_asof(self, on, by,             # <<<<<<<<<<<<<<
 *                                          right_dataset, right_on, right_by,
 *                                          tolerance, output_type=InMemoryDataset)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pac); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":991
 *         return _pac()._perform_join_asof(self, on, by,
 *                                          right_dataset, right_on, right_by,
 *                                          tolerance, output_type=InMemoryDataset)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[8 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_on, __pyx_v_by, __pyx_v_right_dataset, __pyx_v_right_on, __pyx_v_right_by, __pyx_v_tolerance};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_output_type, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset), __pyx_t_6, __pyx_callargs+8, 0) < (0)) __PYX_ERR(0, 989, __pyx_L1_error)
    __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_perform_join_asof, __pyx_callargs+__pyx_t_7, (8-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":925
 *         )
 * 
 *     def join_asof(self, right_dataset, on, by, tolerance, right_on=None, right_by=None):             # <<<<<<<<<<<<<<
 *         """
 *         Perform an asof join between this dataset and another one.
*/

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

/* "pyarrow/_dataset.pxd":49
 *         SharedPtrNoGIL[CDataset] wrapped
 *         CDataset* dataset
 *         public dict _scan_options             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_scan_options);
  __Pyx_DECREF(__pyx_v_self->_scan_options);
  __pyx_v_self->_scan_options = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.Dataset._scan_options.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_4__del__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_7Dataset_13_scan_options_4__del__(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_scan_options);
  __Pyx_DECREF(__pyx_v_self->_scan_options);
  __pyx_v_self->_scan_options = ((PyObject*)Py_None);

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_32__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_31__reduce_cython__, "Dataset.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_32__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_32__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_31__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_32__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_31__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_31__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_dataset_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.__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.dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_34__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Dataset_33__setstate_cython__, "Dataset.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Dataset_34__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_34__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_33__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Dataset_34__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Dataset.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Dataset_33__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Dataset_33__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_dataset_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":1011
 *         CInMemoryDataset* in_memory_dataset
 * 
 *     def __init__(self, source, Schema schema=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CInMemoryDataset] in_memory_dataset
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_schema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1011, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1011, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 1011, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1011, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
    }
    __pyx_v_source = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1011, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.InMemoryDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 1011, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_15InMemoryDataset___init__(((struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *)__pyx_v_self), __pyx_v_source, __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_15InMemoryDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::shared_ptr<arrow::dataset::InMemoryDataset>  __pyx_v_in_memory_dataset;
  PyObject *__pyx_v_batches = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_table = NULL;
  int __pyx_r;
  __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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13[4];
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  std::shared_ptr< arrow::Table>  __pyx_t_16;
  std::shared_ptr<arrow::dataset::InMemoryDataset>  __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_source);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/_dataset.pyx":1015
 *             shared_ptr[CInMemoryDataset] in_memory_dataset
 * 
 *         if isinstance(source, (pa.RecordBatch, pa.Table)):             # <<<<<<<<<<<<<<
 *             source = [source]
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_RecordBatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_source, __pyx_t_2); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_source, __pyx_t_3); 
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":1016
 * 
 *         if isinstance(source, (pa.RecordBatch, pa.Table)):
 *             source = [source]             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):
*/
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_source) != (0)) __PYX_ERR(0, 1016, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_dataset.pyx":1015
 *             shared_ptr[CInMemoryDataset] in_memory_dataset
 * 
 *         if isinstance(source, (pa.RecordBatch, pa.Table)):             # <<<<<<<<<<<<<<
 *             source = [source]
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1018
 *             source = [source]
 * 
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):             # <<<<<<<<<<<<<<
 *             batches = []
 *             for item in source:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RecordBatchReader); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyList_Check(__pyx_v_source); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = PyTuple_Check(__pyx_v_source); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_source, __pyx_t_3); 
  __pyx_t_4 = __pyx_t_5;
  __pyx_L7_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(__pyx_t_4)) {

    /* "pyarrow/_dataset.pyx":1019
 * 
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):
 *             batches = []             # <<<<<<<<<<<<<<
 *             for item in source:
 *                 if isinstance(item, pa.RecordBatch):
*/
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_batches = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":1020
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):
 *             batches = []
 *             for item in source:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, pa.RecordBatch):
 *                     batches.append(item)
*/
    if (likely(PyList_CheckExact(__pyx_v_source)) || PyTuple_CheckExact(__pyx_v_source)) {
      __pyx_t_3 = __pyx_v_source; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1020, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1020, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1020, __pyx_L1_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error)
      } else {
        __pyx_t_2 = __pyx_t_7(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1020, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/_dataset.pyx":1021
 *             batches = []
 *             for item in source:
 *                 if isinstance(item, pa.RecordBatch):             # <<<<<<<<<<<<<<
 *                     batches.append(item)
 *                 elif isinstance(item, pa.Table):
*/
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RecordBatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_item, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1021, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_4) {

        /* "pyarrow/_dataset.pyx":1022
 *             for item in source:
 *                 if isinstance(item, pa.RecordBatch):
 *                     batches.append(item)             # <<<<<<<<<<<<<<
 *                 elif isinstance(item, pa.Table):
 *                     batches.extend(item.to_batches())
*/
        __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_batches, __pyx_v_item); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error)

        /* "pyarrow/_dataset.pyx":1021
 *             batches = []
 *             for item in source:
 *                 if isinstance(item, pa.RecordBatch):             # <<<<<<<<<<<<<<
 *                     batches.append(item)
 *                 elif isinstance(item, pa.Table):
*/
        goto __pyx_L12;
      }

      /* "pyarrow/_dataset.pyx":1023
 *                 if isinstance(item, pa.RecordBatch):
 *                     batches.append(item)
 *                 elif isinstance(item, pa.Table):             # <<<<<<<<<<<<<<
 *                     batches.extend(item.to_batches())
 *                 else:
*/
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_item, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1023, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (likely(__pyx_t_4)) {

        /* "pyarrow/_dataset.pyx":1024
 *                     batches.append(item)
 *                 elif isinstance(item, pa.Table):
 *                     batches.extend(item.to_batches())             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise TypeError(
*/
        __pyx_t_1 = __pyx_v_item;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_batches, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_batches, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1024, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "pyarrow/_dataset.pyx":1023
 *                 if isinstance(item, pa.RecordBatch):
 *                     batches.append(item)
 *                 elif isinstance(item, pa.Table):             # <<<<<<<<<<<<<<
 *                     batches.extend(item.to_batches())
 *                 else:
*/
        goto __pyx_L12;
      }

      /* "pyarrow/_dataset.pyx":1026
 *                     batches.extend(item.to_batches())
 *                 else:
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         'Expected a list of tables or batches. The given list '
 *                         'contains a ' + type(item).__name__)
*/
      /*else*/ {
        __pyx_t_1 = NULL;

        /* "pyarrow/_dataset.pyx":1028
 *                     raise TypeError(
 *                         'Expected a list of tables or batches. The given list '
 *                         'contains a ' + type(item).__name__)             # <<<<<<<<<<<<<<
 *                 if schema is None:
 *                     schema = item.schema
*/
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_Expected_a_list_of_tables_or_bat, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1028, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_11};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __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(0, 1026, __pyx_L1_error)
      }
      __pyx_L12:;

      /* "pyarrow/_dataset.pyx":1029
 *                         'Expected a list of tables or batches. The given list '
 *                         'contains a ' + type(item).__name__)
 *                 if schema is None:             # <<<<<<<<<<<<<<
 *                     schema = item.schema
 *                 elif not schema.equals(item.schema):
*/
      __pyx_t_4 = (((PyObject *)__pyx_v_schema) == Py_None);
      if (__pyx_t_4) {

        /* "pyarrow/_dataset.pyx":1030
 *                         'contains a ' + type(item).__name__)
 *                 if schema is None:
 *                     schema = item.schema             # <<<<<<<<<<<<<<
 *                 elif not schema.equals(item.schema):
 *                     raise ArrowTypeError(
*/
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(0, 1030, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "pyarrow/_dataset.pyx":1029
 *                         'Expected a list of tables or batches. The given list '
 *                         'contains a ' + type(item).__name__)
 *                 if schema is None:             # <<<<<<<<<<<<<<
 *                     schema = item.schema
 *                 elif not schema.equals(item.schema):
*/
        goto __pyx_L13;
      }

      /* "pyarrow/_dataset.pyx":1031
 *                 if schema is None:
 *                     schema = item.schema
 *                 elif not schema.equals(item.schema):             # <<<<<<<<<<<<<<
 *                     raise ArrowTypeError(
 *                         f'Item has schema\n{item.schema}\nwhich does not '
*/
      __pyx_t_11 = ((PyObject *)__pyx_v_schema);
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_1};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1031, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = (!__pyx_t_4);
      if (unlikely(__pyx_t_5)) {

        /* "pyarrow/_dataset.pyx":1032
 *                     schema = item.schema
 *                 elif not schema.equals(item.schema):
 *                     raise ArrowTypeError(             # <<<<<<<<<<<<<<
 *                         f'Item has schema\n{item.schema}\nwhich does not '
 *                         f'match expected schema\n{schema}')
*/
        __pyx_t_1 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ArrowTypeError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1032, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);

        /* "pyarrow/_dataset.pyx":1033
 *                 elif not schema.equals(item.schema):
 *                     raise ArrowTypeError(
 *                         f'Item has schema\n{item.schema}\nwhich does not '             # <<<<<<<<<<<<<<
 *                         f'match expected schema\n{schema}')
 *             if not batches and schema is None:
*/
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1033, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1033, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "pyarrow/_dataset.pyx":1034
 *                     raise ArrowTypeError(
 *                         f'Item has schema\n{item.schema}\nwhich does not '
 *                         f'match expected schema\n{schema}')             # <<<<<<<<<<<<<<
 *             if not batches and schema is None:
 *                 raise ValueError('Must provide schema to construct in-memory '
*/
        __pyx_t_10 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1034, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Item_has_schema;
        __pyx_t_13[1] = __pyx_t_12;
        __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_which_does_not_match_expected_s;
        __pyx_t_13[3] = __pyx_t_10;

        /* "pyarrow/_dataset.pyx":1033
 *                 elif not schema.equals(item.schema):
 *                     raise ArrowTypeError(
 *                         f'Item has schema\n{item.schema}\nwhich does not '             # <<<<<<<<<<<<<<
 *                         f'match expected schema\n{schema}')
 *             if not batches and schema is None:
*/
        __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1033, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
          assert(__pyx_t_1);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
          __pyx_t_9 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_14};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __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(0, 1032, __pyx_L1_error)

        /* "pyarrow/_dataset.pyx":1031
 *                 if schema is None:
 *                     schema = item.schema
 *                 elif not schema.equals(item.schema):             # <<<<<<<<<<<<<<
 *                     raise ArrowTypeError(
 *                         f'Item has schema\n{item.schema}\nwhich does not '
*/
      }
      __pyx_L13:;

      /* "pyarrow/_dataset.pyx":1020
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):
 *             batches = []
 *             for item in source:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, pa.RecordBatch):
 *                     batches.append(item)
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":1035
 *                         f'Item has schema\n{item.schema}\nwhich does not '
 *                         f'match expected schema\n{schema}')
 *             if not batches and schema is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must provide schema to construct in-memory '
 *                                  'dataset from an empty list')
*/
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_batches);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1035, __pyx_L1_error)
      __pyx_t_4 = (__pyx_temp != 0);
    }

    __pyx_t_15 = (!__pyx_t_4);
    if (__pyx_t_15) {
    } else {
      __pyx_t_5 = __pyx_t_15;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_15 = (((PyObject *)__pyx_v_schema) == Py_None);
    __pyx_t_5 = __pyx_t_15;
    __pyx_L16_bool_binop_done:;
    if (unlikely(__pyx_t_5)) {

      /* "pyarrow/_dataset.pyx":1036
 *                         f'match expected schema\n{schema}')
 *             if not batches and schema is None:
 *                 raise ValueError('Must provide schema to construct in-memory '             # <<<<<<<<<<<<<<
 *                                  'dataset from an empty list')
 *             table = pa.Table.from_batches(batches, schema=schema)
*/
      __pyx_t_2 = NULL;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Must_provide_schema_to_construct};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1036, __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(0, 1036, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":1035
 *                         f'Item has schema\n{item.schema}\nwhich does not '
 *                         f'match expected schema\n{schema}')
 *             if not batches and schema is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must provide schema to construct in-memory '
 *                                  'dataset from an empty list')
*/
    }

    /* "pyarrow/_dataset.pyx":1038
 *                 raise ValueError('Must provide schema to construct in-memory '
 *                                  'dataset from an empty list')
 *             table = pa.Table.from_batches(batches, schema=schema)             # <<<<<<<<<<<<<<
 *             in_memory_dataset = make_shared[CInMemoryDataset](
 *                 pyarrow_unwrap_table(table))
*/
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Table); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_2 = __pyx_t_14;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_batches};
      __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, ((PyObject *)__pyx_v_schema), __pyx_t_11, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_batches, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_table = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":1040
 *             table = pa.Table.from_batches(batches, schema=schema)
 *             in_memory_dataset = make_shared[CInMemoryDataset](
 *                 pyarrow_unwrap_table(table))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError(
*/
    __pyx_t_16 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_table(__pyx_v_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1040, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1039
 *                                  'dataset from an empty list')
 *             table = pa.Table.from_batches(batches, schema=schema)
 *             in_memory_dataset = make_shared[CInMemoryDataset](             # <<<<<<<<<<<<<<
 *                 pyarrow_unwrap_table(table))
 *         else:
*/
    try {
      __pyx_t_17 = std::make_shared<arrow::dataset::InMemoryDataset>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 1039, __pyx_L1_error)
    }
    __pyx_v_in_memory_dataset = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_17);

    /* "pyarrow/_dataset.pyx":1018
 *             source = [source]
 * 
 *         if isinstance(source, (list, tuple, pa.RecordBatchReader)):             # <<<<<<<<<<<<<<
 *             batches = []
 *             for item in source:
*/
    goto __pyx_L6;
  }

  /* "pyarrow/_dataset.pyx":1042
 *                 pyarrow_unwrap_table(table))
 *         else:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'Expected a Table, RecordBatch, list of Table/RecordBatch, '
 *                 'or RecordBatchReader instead of the given type: ' +
*/
  /*else*/ {
    __pyx_t_14 = NULL;

    /* "pyarrow/_dataset.pyx":1045
 *                 'Expected a Table, RecordBatch, list of Table/RecordBatch, '
 *                 'or RecordBatchReader instead of the given type: ' +
 *                 type(source).__name__             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_source)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "pyarrow/_dataset.pyx":1044
 *             raise TypeError(
 *                 'Expected a Table, RecordBatch, list of Table/RecordBatch, '
 *                 'or RecordBatchReader instead of the given type: ' +             # <<<<<<<<<<<<<<
 *                 type(source).__name__
 *             )
*/
    __pyx_t_2 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_Expected_a_Table_RecordBatch_lis, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __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(0, 1042, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "pyarrow/_dataset.pyx":1048
 *             )
 * 
 *         self.init(<shared_ptr[CDataset]> in_memory_dataset)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_InMemoryDataset *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), ((std::shared_ptr<arrow::dataset::Dataset> )__pyx_v_in_memory_dataset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1011
 *         CInMemoryDataset* in_memory_dataset
 * 
 *     def __init__(self, source, Schema schema=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CInMemoryDataset] in_memory_dataset
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow._dataset.InMemoryDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_batches);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1050
 *         self.init(<shared_ptr[CDataset]> in_memory_dataset)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.in_memory_dataset = <CInMemoryDataset*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_15InMemoryDataset_init(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":1051
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.in_memory_dataset = <CInMemoryDataset*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_7Dataset_init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1052
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)
 *         self.in_memory_dataset = <CInMemoryDataset*> sp.get()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->in_memory_dataset = ((arrow::dataset::InMemoryDataset *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":1050
 *         self.init(<shared_ptr[CDataset]> in_memory_dataset)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.in_memory_dataset = <CInMemoryDataset*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.InMemoryDataset.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__, "InMemoryDataset.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_dataset_self_in_memory_data, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.InMemoryDataset.__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.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__, "InMemoryDataset.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.InMemoryDataset.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_dataset_self_in_memory_data, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":1072
 *         CUnionDataset* union_dataset
 * 
 *     def __init__(self, Schema schema not None, children):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Dataset child
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_12UnionDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_12UnionDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_children = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_children,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1072, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1072, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1072, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1072, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1072, __pyx_L3_error)
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_children = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1072, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.UnionDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 1072, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12UnionDataset___init__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *)__pyx_v_self), __pyx_v_schema, __pyx_v_children);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_12UnionDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_children) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_child = 0;
  arrow::dataset::DatasetVector __pyx_v_c_children;
  std::shared_ptr<arrow::dataset::UnionDataset>  __pyx_v_union_dataset;
  int __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::shared_ptr< arrow::Schema>  __pyx_t_5;
  std::shared_ptr<arrow::dataset::UnionDataset>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":1078
 *             shared_ptr[CUnionDataset] union_dataset
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_children.push_back(child.wrapped)
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_children)) || PyTuple_CheckExact(__pyx_v_children)) {
    __pyx_t_1 = __pyx_v_children; __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_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1078, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1078, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1078, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset))))) __PYX_ERR(0, 1078, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":1079
 * 
 *         for child in children:
 *             c_children.push_back(child.wrapped)             # <<<<<<<<<<<<<<
 * 
 *         union_dataset = GetResultValue(CUnionDataset.Make(
*/
    try {
      __pyx_v_c_children.push_back(__pyx_v_child->wrapped);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 1079, __pyx_L1_error)
    }

    /* "pyarrow/_dataset.pyx":1078
 *             shared_ptr[CUnionDataset] union_dataset
 * 
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c_children.push_back(child.wrapped)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1082
 * 
 *         union_dataset = GetResultValue(CUnionDataset.Make(
 *             pyarrow_unwrap_schema(schema), move(c_children)))             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CDataset]> union_dataset)
 * 
*/
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1081
 *             c_children.push_back(child.wrapped)
 * 
 *         union_dataset = GetResultValue(CUnionDataset.Make(             # <<<<<<<<<<<<<<
 *             pyarrow_unwrap_schema(schema), move(c_children)))
 *         self.init(<shared_ptr[CDataset]> union_dataset)
*/
  __pyx_t_6 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::UnionDataset> >(arrow::dataset::UnionDataset::Make(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5), cython_std::move<arrow::dataset::DatasetVector>(__pyx_v_c_children))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
  __pyx_v_union_dataset = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1083
 *         union_dataset = GetResultValue(CUnionDataset.Make(
 *             pyarrow_unwrap_schema(schema), move(c_children)))
 *         self.init(<shared_ptr[CDataset]> union_dataset)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDataset *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), ((std::shared_ptr<arrow::dataset::Dataset> )__pyx_v_union_dataset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1072
 *         CUnionDataset* union_dataset
 * 
 *     def __init__(self, Schema schema not None, children):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Dataset child
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.UnionDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1085
 *         self.init(<shared_ptr[CDataset]> union_dataset)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.union_dataset = <CUnionDataset*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_12UnionDataset_init(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":1086
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.union_dataset = <CUnionDataset*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_7Dataset_init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1087
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)
 *         self.union_dataset = <CUnionDataset*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_v_self->union_dataset = ((arrow::dataset::UnionDataset *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":1085
 *         self.init(<shared_ptr[CDataset]> union_dataset)
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.union_dataset = <CUnionDataset*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.UnionDataset.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":1089
 *         self.union_dataset = <CUnionDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return UnionDataset, (self.schema, self.children)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12UnionDataset_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12UnionDataset_2__reduce__, "UnionDataset.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12UnionDataset_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12UnionDataset_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12UnionDataset_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12UnionDataset_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12UnionDataset_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12UnionDataset_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":1090
 * 
 *     def __reduce__(self):
 *         return UnionDataset, (self.schema, self.children)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1090, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 1090, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset)) != (0)) __PYX_ERR(0, 1090, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1090, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1089
 *         self.union_dataset = <CUnionDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return UnionDataset, (self.schema, self.children)
 * 
*/

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

/* "pyarrow/_dataset.pyx":1092
 *         return UnionDataset, (self.schema, self.children)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def children(self):
 *         cdef CDatasetVector children = self.union_dataset.children()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12UnionDataset_8children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12UnionDataset_8children_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12UnionDataset_8children___get__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12UnionDataset_8children___get__(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *__pyx_v_self) {
  arrow::dataset::DatasetVector __pyx_v_children;
  std::vector<std::shared_ptr<arrow::dataset::Dataset> > ::size_type __pyx_7genexpr__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr<arrow::dataset::Dataset> > ::size_type __pyx_t_2;
  std::vector<std::shared_ptr<arrow::dataset::Dataset> > ::size_type __pyx_t_3;
  std::vector<std::shared_ptr<arrow::dataset::Dataset> > ::size_type __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1094
 *     @property
 *     def children(self):
 *         cdef CDatasetVector children = self.union_dataset.children()             # <<<<<<<<<<<<<<
 *         return [Dataset.wrap(children[i]) for i in range(children.size())]
 * 
*/
  __pyx_v_children = __pyx_v_self->union_dataset->children();

  /* "pyarrow/_dataset.pyx":1095
 *     def children(self):
 *         cdef CDatasetVector children = self.union_dataset.children()
 *         return [Dataset.wrap(children[i]) for i in range(children.size())]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_children.size();
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_7genexpr__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = __pyx_f_7pyarrow_8_dataset_7Dataset_wrap((__pyx_v_children[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1095, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1092
 *         return UnionDataset, (self.schema, self.children)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def children(self):
 *         cdef CDatasetVector children = self.union_dataset.children()
*/

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

/* "pyarrow/_dataset.pyx":1122
 *         CFileSystemDataset* filesystem_dataset
 * 
 *     def __init__(self, fragments, Schema schema, FileFormat format,             # <<<<<<<<<<<<<<
 *                  FileSystem filesystem=None, root_partition=None):
 *         cdef:
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fragments = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format = 0;
  struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem = 0;
  PyObject *__pyx_v_root_partition = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fragments,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_filesystem,&__pyx_mstate_global->__pyx_n_u_root_partition,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1122, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1122, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1123
 * 
 *     def __init__(self, fragments, Schema schema, FileFormat format,
 *                  FileSystem filesystem=None, root_partition=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             FileFragment fragment=None
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, i); __PYX_ERR(0, 1122, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1122, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1122, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1122, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_fragments = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_format = ((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)values[2]);
    __pyx_v_filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)values[3]);
    __pyx_v_root_partition = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, __pyx_nargs); __PYX_ERR(0, 1122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 1122, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_format), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, 1, "format", 0))) __PYX_ERR(0, 1122, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filesystem), __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem, 1, "filesystem", 0))) __PYX_ERR(0, 1123, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset___init__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self), __pyx_v_fragments, __pyx_v_schema, __pyx_v_format, __pyx_v_filesystem, __pyx_v_root_partition);

  /* "pyarrow/_dataset.pyx":1122
 *         CFileSystemDataset* filesystem_dataset
 * 
 *     def __init__(self, fragments, Schema schema, FileFormat format,             # <<<<<<<<<<<<<<
 *                  FileSystem filesystem=None, root_partition=None):
 *         cdef:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self, PyObject *__pyx_v_fragments, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, PyObject *__pyx_v_root_partition) {
  struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_fragment = 0;
  std::vector<std::shared_ptr<arrow::dataset::FileFragment> >  __pyx_v_c_fragments;
  arrow::Result<std::shared_ptr<arrow::dataset::Dataset> >  __pyx_v_result;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_v_c_filesystem;
  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[3];
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  std::shared_ptr<arrow::dataset::Fragment>  __pyx_t_11;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_t_12;
  std::shared_ptr< arrow::Schema>  __pyx_t_13;
  arrow::compute::Expression __pyx_t_14;
  std::shared_ptr<arrow::dataset::FileFormat>  __pyx_t_15;
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_filesystem);
  __Pyx_INCREF(__pyx_v_root_partition);

  /* "pyarrow/_dataset.pyx":1125
 *                  FileSystem filesystem=None, root_partition=None):
 *         cdef:
 *             FileFragment fragment=None             # <<<<<<<<<<<<<<
 *             vector[shared_ptr[CFileFragment]] c_fragments
 *             CResult[shared_ptr[CDataset]] result
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_fragment = ((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)Py_None);

  /* "pyarrow/_dataset.pyx":1130
 *             shared_ptr[CFileSystem] c_filesystem
 * 
 *         if root_partition is None:             # <<<<<<<<<<<<<<
 *             root_partition = _true
 *         elif not isinstance(root_partition, Expression):
*/
  __pyx_t_1 = (__pyx_v_root_partition == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":1131
 * 
 *         if root_partition is None:
 *             root_partition = _true             # <<<<<<<<<<<<<<
 *         elif not isinstance(root_partition, Expression):
 *             raise TypeError(
*/
    __Pyx_INCREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
    __Pyx_DECREF_SET(__pyx_v_root_partition, ((PyObject *)__pyx_v_7pyarrow_8_dataset__true));

    /* "pyarrow/_dataset.pyx":1130
 *             shared_ptr[CFileSystem] c_filesystem
 * 
 *         if root_partition is None:             # <<<<<<<<<<<<<<
 *             root_partition = _true
 *         elif not isinstance(root_partition, Expression):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":1132
 *         if root_partition is None:
 *             root_partition = _true
 *         elif not isinstance(root_partition, Expression):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Argument 'root_partition' has incorrect type (expected "
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_root_partition, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":1133
 *             root_partition = _true
 *         elif not isinstance(root_partition, Expression):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Argument 'root_partition' has incorrect type (expected "
 *                 f"Expression, got {type(root_partition)})"
*/
    __pyx_t_4 = NULL;

    /* "pyarrow/_dataset.pyx":1135
 *             raise TypeError(
 *                 "Argument 'root_partition' has incorrect type (expected "
 *                 f"Expression, got {type(root_partition)})"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_root_partition)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Argument_root_partition_has_inco;
    __pyx_t_6[1] = __pyx_t_5;
    __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__20;

    /* "pyarrow/_dataset.pyx":1134
 *         elif not isinstance(root_partition, Expression):
 *             raise TypeError(
 *                 "Argument 'root_partition' has incorrect type (expected "             # <<<<<<<<<<<<<<
 *                 f"Expression, got {type(root_partition)})"
 *             )
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 71 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __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(0, 1133, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1132
 *         if root_partition is None:
 *             root_partition = _true
 *         elif not isinstance(root_partition, Expression):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Argument 'root_partition' has incorrect type (expected "
*/
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":1138
 *             )
 * 
 *         for fragment in fragments:             # <<<<<<<<<<<<<<
 *             c_fragments.push_back(
 *                 static_pointer_cast[CFileFragment, CFragment](
*/
  if (likely(PyList_CheckExact(__pyx_v_fragments)) || PyTuple_CheckExact(__pyx_v_fragments)) {
    __pyx_t_3 = __pyx_v_fragments; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_fragments); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1138, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error)
    } else {
      __pyx_t_7 = __pyx_t_10(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1138, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_7);
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment))))) __PYX_ERR(0, 1138, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_fragment, ((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "pyarrow/_dataset.pyx":1141
 *             c_fragments.push_back(
 *                 static_pointer_cast[CFileFragment, CFragment](
 *                     fragment.unwrap()))             # <<<<<<<<<<<<<<
 * 
 *             if filesystem is None:
*/
    __pyx_t_11 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFragment *)__pyx_v_fragment->__pyx_base.__pyx_vtab)->__pyx_base.unwrap(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_fragment)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1141, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1139
 * 
 *         for fragment in fragments:
 *             c_fragments.push_back(             # <<<<<<<<<<<<<<
 *                 static_pointer_cast[CFileFragment, CFragment](
 *                     fragment.unwrap()))
*/
    try {
      __pyx_v_c_fragments.push_back(std::static_pointer_cast<arrow::dataset::FileFragment,arrow::dataset::Fragment>(__pyx_t_11));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 1139, __pyx_L1_error)
    }

    /* "pyarrow/_dataset.pyx":1143
 *                     fragment.unwrap()))
 * 
 *             if filesystem is None:             # <<<<<<<<<<<<<<
 *                 filesystem = fragment.filesystem
 * 
*/
    __pyx_t_2 = (((PyObject *)__pyx_v_filesystem) == Py_None);
    if (__pyx_t_2) {

      /* "pyarrow/_dataset.pyx":1144
 * 
 *             if filesystem is None:
 *                 filesystem = fragment.filesystem             # <<<<<<<<<<<<<<
 * 
 *         if filesystem is not None:
*/
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_fragment), __pyx_mstate_global->__pyx_n_u_filesystem); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem))))) __PYX_ERR(0, 1144, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_filesystem, ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "pyarrow/_dataset.pyx":1143
 *                     fragment.unwrap()))
 * 
 *             if filesystem is None:             # <<<<<<<<<<<<<<
 *                 filesystem = fragment.filesystem
 * 
*/
    }

    /* "pyarrow/_dataset.pyx":1138
 *             )
 * 
 *         for fragment in fragments:             # <<<<<<<<<<<<<<
 *             c_fragments.push_back(
 *                 static_pointer_cast[CFileFragment, CFragment](
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":1146
 *                 filesystem = fragment.filesystem
 * 
 *         if filesystem is not None:             # <<<<<<<<<<<<<<
 *             c_filesystem = filesystem.unwrap()
 * 
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_filesystem) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":1147
 * 
 *         if filesystem is not None:
 *             c_filesystem = filesystem.unwrap()             # <<<<<<<<<<<<<<
 * 
 *         result = CFileSystemDataset.Make(
*/
    __pyx_t_12 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem->__pyx_vtab)->unwrap(__pyx_v_filesystem); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1147, __pyx_L1_error)
    __pyx_v_c_filesystem = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12);

    /* "pyarrow/_dataset.pyx":1146
 *                 filesystem = fragment.filesystem
 * 
 *         if filesystem is not None:             # <<<<<<<<<<<<<<
 *             c_filesystem = filesystem.unwrap()
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1150
 * 
 *         result = CFileSystemDataset.Make(
 *             pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *             (<Expression> root_partition).unwrap(),
 *             format.unwrap(),
*/
  __pyx_t_13 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1150, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1151
 *         result = CFileSystemDataset.Make(
 *             pyarrow_unwrap_schema(schema),
 *             (<Expression> root_partition).unwrap(),             # <<<<<<<<<<<<<<
 *             format.unwrap(),
 *             c_filesystem,
*/
  __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_root_partition)->__pyx_vtab)->unwrap(((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_root_partition)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1151, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1152
 *             pyarrow_unwrap_schema(schema),
 *             (<Expression> root_partition).unwrap(),
 *             format.unwrap(),             # <<<<<<<<<<<<<<
 *             c_filesystem,
 *             c_fragments
*/
  __pyx_t_15 = __pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap(__pyx_v_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1152, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1149
 *             c_filesystem = filesystem.unwrap()
 * 
 *         result = CFileSystemDataset.Make(             # <<<<<<<<<<<<<<
 *             pyarrow_unwrap_schema(schema),
 *             (<Expression> root_partition).unwrap(),
*/
  __pyx_v_result = arrow::dataset::FileSystemDataset::Make(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_15), __pyx_v_c_filesystem, __pyx_v_c_fragments);

  /* "pyarrow/_dataset.pyx":1156
 *             c_fragments
 *         )
 *         self.init(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_16 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Dataset> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1156, __pyx_L1_error)
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_t_16); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1156, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1122
 *         CFileSystemDataset* filesystem_dataset
 * 
 *     def __init__(self, fragments, Schema schema, FileFormat format,             # <<<<<<<<<<<<<<
 *                  FileSystem filesystem=None, root_partition=None):
 *         cdef:
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_fragment);
  __Pyx_XDECREF((PyObject *)__pyx_v_filesystem);
  __Pyx_XDECREF(__pyx_v_root_partition);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1158
 *         self.init(GetResultValue(result))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def filesystem(self):
 *         return FileSystem.wrap(self.filesystem_dataset.filesystem())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_10filesystem_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_10filesystem_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_10filesystem___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_10filesystem___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1160
 *     @property
 *     def filesystem(self):
 *         return FileSystem.wrap(self.filesystem_dataset.filesystem())             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_3_fs_FileSystem->wrap(__pyx_v_self->filesystem_dataset->filesystem()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1158
 *         self.init(GetResultValue(result))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def filesystem(self):
 *         return FileSystem.wrap(self.filesystem_dataset.filesystem())
*/

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

/* "pyarrow/_dataset.pyx":1162
 *         return FileSystem.wrap(self.filesystem_dataset.filesystem())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_12partitioning_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_12partitioning_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_12partitioning___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_12partitioning___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_v_c_partitioning;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1172
 *         other cases, this returns None.
 *         """
 *         c_partitioning = self.filesystem_dataset.partitioning()             # <<<<<<<<<<<<<<
 *         if c_partitioning.get() == nullptr:
 *             return None
*/
  __pyx_v_c_partitioning = __pyx_v_self->filesystem_dataset->partitioning();

  /* "pyarrow/_dataset.pyx":1173
 *         """
 *         c_partitioning = self.filesystem_dataset.partitioning()
 *         if c_partitioning.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  __pyx_t_1 = (__pyx_v_c_partitioning.get() == nullptr);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":1174
 *         c_partitioning = self.filesystem_dataset.partitioning()
 *         if c_partitioning.get() == nullptr:
 *             return None             # <<<<<<<<<<<<<<
 *         try:
 *             return Partitioning.wrap(c_partitioning)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":1173
 *         """
 *         c_partitioning = self.filesystem_dataset.partitioning()
 *         if c_partitioning.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         try:
*/
  }

  /* "pyarrow/_dataset.pyx":1175
 *         if c_partitioning.get() == nullptr:
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             return Partitioning.wrap(c_partitioning)
 *         except TypeError:
*/
  {
    __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/_dataset.pyx":1176
 *             return None
 *         try:
 *             return Partitioning.wrap(c_partitioning)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             # e.g. type_name "default"
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __pyx_f_7pyarrow_8_dataset_12Partitioning_wrap(__pyx_v_c_partitioning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1176, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "pyarrow/_dataset.pyx":1175
 *         if c_partitioning.get() == nullptr:
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             return Partitioning.wrap(c_partitioning)
 *         except TypeError:
*/
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_dataset.pyx":1177
 *         try:
 *             return Partitioning.wrap(c_partitioning)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             # e.g. type_name "default"
 *             return None
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
    if (__pyx_t_6) {
      __Pyx_ErrRestore(0,0,0);

      /* "pyarrow/_dataset.pyx":1179
 *         except TypeError:
 *             # e.g. type_name "default"
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L7_except_return;
    }
    goto __pyx_L6_except_error;

    /* "pyarrow/_dataset.pyx":1175
 *         if c_partitioning.get() == nullptr:
 *             return None
 *         try:             # <<<<<<<<<<<<<<
 *             return Partitioning.wrap(c_partitioning)
 *         except TypeError:
*/
    __pyx_L6_except_error:;
    __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_L8_try_return:;
    __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_L0;
    __pyx_L7_except_return:;
    __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_L0;
  }

  /* "pyarrow/_dataset.pyx":1162
 *         return FileSystem.wrap(self.filesystem_dataset.filesystem())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.partitioning.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1181
 *             return None
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_17FileSystemDataset_init(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self, std::shared_ptr<arrow::dataset::Dataset>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":1182
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_7Dataset_init(((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1183
 *     cdef void init(self, const shared_ptr[CDataset]& sp):
 *         Dataset.init(self, sp)
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_v_self->filesystem_dataset = ((arrow::dataset::FileSystemDataset *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":1181
 *             return None
 * 
 *     cdef void init(self, const shared_ptr[CDataset]& sp):             # <<<<<<<<<<<<<<
 *         Dataset.init(self, sp)
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":1185
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__, "FileSystemDataset.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":1186
 * 
 *     def __reduce__(self):
 *         return FileSystemDataset, (             # <<<<<<<<<<<<<<
 *             list(self.get_fragments()),
 *             self.schema,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1187
 *     def __reduce__(self):
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),             # <<<<<<<<<<<<<<
 *             self.schema,
 *             self.format,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_fragments_2, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1188
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),
 *             self.schema,             # <<<<<<<<<<<<<<
 *             self.format,
 *             self.filesystem,
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":1189
 *             list(self.get_fragments()),
 *             self.schema,
 *             self.format,             # <<<<<<<<<<<<<<
 *             self.filesystem,
 *             self.partition_expression
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1190
 *             self.schema,
 *             self.format,
 *             self.filesystem,             # <<<<<<<<<<<<<<
 *             self.partition_expression
 *         )
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_filesystem); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1191
 *             self.format,
 *             self.filesystem,
 *             self.partition_expression             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partition_expression); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1187
 *     def __reduce__(self):
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),             # <<<<<<<<<<<<<<
 *             self.schema,
 *             self.format,
*/
  __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1187, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1187, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 1187, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5) != (0)) __PYX_ERR(0, 1187, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6) != (0)) __PYX_ERR(0, 1187, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;

  /* "pyarrow/_dataset.pyx":1186
 * 
 *     def __reduce__(self):
 *         return FileSystemDataset, (             # <<<<<<<<<<<<<<
 *             list(self.get_fragments()),
 *             self.schema,
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset)) != (0)) __PYX_ERR(0, 1186, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1186, __pyx_L1_error);
  __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1185
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1194
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5from_paths(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_4from_paths, "FileSystemDataset.from_paths(cls, paths, schema=None, format=None, filesystem=None, partitions=None, root_partition=None)\n\nA Dataset created from a list of paths on a particular filesystem.\n\nParameters\n----------\npaths : list of str\n    List of file paths to create the fragments from.\nschema : Schema\n    The top-level schema of the DataDataset.\nformat : FileFormat\n    File format to create fragments from, currently only\n    ParquetFileFormat, IpcFileFormat, CsvFileFormat, and JsonFileFormat are supported.\nfilesystem : FileSystem\n    The filesystem which files are from.\npartitions : list[Expression], optional\n    Attach additional partition information for the file paths.\nroot_partition : Expression, optional\n    The top-level partition of the DataDataset.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_17FileSystemDataset_5from_paths = {"from_paths", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5from_paths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_4from_paths};
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5from_paths(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_paths = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_filesystem = 0;
  PyObject *__pyx_v_partitions = 0;
  PyObject *__pyx_v_root_partition = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_paths (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_paths,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_filesystem,&__pyx_mstate_global->__pyx_n_u_partitions,&__pyx_mstate_global->__pyx_n_u_root_partition,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1194, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "from_paths", 0) < (0)) __PYX_ERR(0, 1194, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1195
 * 
 *     @classmethod
 *     def from_paths(cls, paths, schema=None, format=None,             # <<<<<<<<<<<<<<
 *                    filesystem=None, partitions=None, root_partition=None):
 *         """
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1196
 *     @classmethod
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):             # <<<<<<<<<<<<<<
 *         """
 *         A Dataset created from a list of paths on a particular filesystem.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_paths", 0, 1, 6, i); __PYX_ERR(0, 1194, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1194, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1194, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1195
 * 
 *     @classmethod
 *     def from_paths(cls, paths, schema=None, format=None,             # <<<<<<<<<<<<<<
 *                    filesystem=None, partitions=None, root_partition=None):
 *         """
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1196
 *     @classmethod
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):             # <<<<<<<<<<<<<<
 *         """
 *         A Dataset created from a list of paths on a particular filesystem.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_paths = values[0];
    __pyx_v_schema = values[1];
    __pyx_v_format = values[2];
    __pyx_v_filesystem = values[3];
    __pyx_v_partitions = values[4];
    __pyx_v_root_partition = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_paths", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 1194, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.from_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_4from_paths(((PyTypeObject*)__pyx_v_cls), __pyx_v_paths, __pyx_v_schema, __pyx_v_format, __pyx_v_filesystem, __pyx_v_partitions, __pyx_v_root_partition);

  /* "pyarrow/_dataset.pyx":1194
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_4from_paths(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_paths, PyObject *__pyx_v_schema, PyObject *__pyx_v_format, PyObject *__pyx_v_filesystem, PyObject *__pyx_v_partitions, PyObject *__pyx_v_root_partition) {
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_class_ = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_fragments = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_path = 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;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[7];
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_paths", 0);
  __Pyx_INCREF(__pyx_v_partitions);
  __Pyx_INCREF(__pyx_v_root_partition);

  /* "pyarrow/_dataset.pyx":1216
 *             The top-level partition of the DataDataset.
 *         """
 *         if root_partition is None:             # <<<<<<<<<<<<<<
 *             root_partition = _true
 * 
*/
  __pyx_t_1 = (__pyx_v_root_partition == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":1217
 *         """
 *         if root_partition is None:
 *             root_partition = _true             # <<<<<<<<<<<<<<
 * 
 *         for arg, class_, name in [
*/
    __Pyx_INCREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
    __Pyx_DECREF_SET(__pyx_v_root_partition, ((PyObject *)__pyx_v_7pyarrow_8_dataset__true));

    /* "pyarrow/_dataset.pyx":1216
 *             The top-level partition of the DataDataset.
 *         """
 *         if root_partition is None:             # <<<<<<<<<<<<<<
 *             root_partition = _true
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1220
 * 
 *         for arg, class_, name in [
 *             (schema, Schema, 'schema'),             # <<<<<<<<<<<<<<
 *             (format, FileFormat, 'format'),
 *             (filesystem, FileSystem, 'filesystem'),
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_schema);
  __Pyx_GIVEREF(__pyx_v_schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_schema) != (0)) __PYX_ERR(0, 1220, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema)) != (0)) __PYX_ERR(0, 1220, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_schema);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_n_u_schema) != (0)) __PYX_ERR(0, 1220, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":1221
 *         for arg, class_, name in [
 *             (schema, Schema, 'schema'),
 *             (format, FileFormat, 'format'),             # <<<<<<<<<<<<<<
 *             (filesystem, FileSystem, 'filesystem'),
 *             (root_partition, Expression, 'root_partition')
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_format);
  __Pyx_GIVEREF(__pyx_v_format);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_format) != (0)) __PYX_ERR(0, 1221, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat)) != (0)) __PYX_ERR(0, 1221, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_format);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_format);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_n_u_format) != (0)) __PYX_ERR(0, 1221, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":1222
 *             (schema, Schema, 'schema'),
 *             (format, FileFormat, 'format'),
 *             (filesystem, FileSystem, 'filesystem'),             # <<<<<<<<<<<<<<
 *             (root_partition, Expression, 'root_partition')
 *         ]:
*/
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_filesystem);
  __Pyx_GIVEREF(__pyx_v_filesystem);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filesystem) != (0)) __PYX_ERR(0, 1222, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem)) != (0)) __PYX_ERR(0, 1222, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_filesystem);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_filesystem);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_mstate_global->__pyx_n_u_filesystem) != (0)) __PYX_ERR(0, 1222, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":1223
 *             (format, FileFormat, 'format'),
 *             (filesystem, FileSystem, 'filesystem'),
 *             (root_partition, Expression, 'root_partition')             # <<<<<<<<<<<<<<
 *         ]:
 *             if not isinstance(arg, class_):
*/
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_root_partition);
  __Pyx_GIVEREF(__pyx_v_root_partition);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_root_partition) != (0)) __PYX_ERR(0, 1223, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression)) != (0)) __PYX_ERR(0, 1223, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_root_partition);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_root_partition);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_n_u_root_partition) != (0)) __PYX_ERR(0, 1223, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":1219
 *             root_partition = _true
 * 
 *         for arg, class_, name in [             # <<<<<<<<<<<<<<
 *             (schema, Schema, 'schema'),
 *             (format, FileFormat, 'format'),
*/
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1219, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1219, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(0, 1219, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(0, 1219, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
  __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_7 >= 4) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7));
    #else
    __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7);
    #endif
    ++__pyx_t_7;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(__pyx_t_6 != Py_None)) {
      PyObject* sequence = __pyx_t_6;
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1219, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1219, __pyx_L1_error)
    }
    __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_class_, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_dataset.pyx":1225
 *             (root_partition, Expression, 'root_partition')
 *         ]:
 *             if not isinstance(arg, class_):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "
*/
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_arg, __pyx_v_class_); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1225, __pyx_L1_error)
    __pyx_t_8 = (!__pyx_t_1);
    if (unlikely(__pyx_t_8)) {

      /* "pyarrow/_dataset.pyx":1226
 *         ]:
 *             if not isinstance(arg, class_):
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "
 *                     f"got {type(arg)})"
*/
      __pyx_t_2 = NULL;

      /* "pyarrow/_dataset.pyx":1227
 *             if not isinstance(arg, class_):
 *                 raise TypeError(
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "             # <<<<<<<<<<<<<<
 *                     f"got {type(arg)})"
 *                 )
*/
      __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_dataset.pyx":1228
 *                 raise TypeError(
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "
 *                     f"got {type(arg)})"             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_arg)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Argument;
      __pyx_t_10[1] = __pyx_t_3;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected;
      __pyx_t_10[3] = __pyx_t_9;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_got;
      __pyx_t_10[5] = __pyx_t_4;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u__20;

      /* "pyarrow/_dataset.pyx":1227
 *             if not isinstance(arg, class_):
 *                 raise TypeError(
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "             # <<<<<<<<<<<<<<
 *                     f"got {type(arg)})"
 *                 )
*/
      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 7, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 31 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1226, __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(0, 1226, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":1225
 *             (root_partition, Expression, 'root_partition')
 *         ]:
 *             if not isinstance(arg, class_):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     f"Argument '{name}' has incorrect type (expected {class_.__name__}, "
*/
    }

    /* "pyarrow/_dataset.pyx":1219
 *             root_partition = _true
 * 
 *         for arg, class_, name in [             # <<<<<<<<<<<<<<
 *             (schema, Schema, 'schema'),
 *             (format, FileFormat, 'format'),
*/
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/_dataset.pyx":1231
 *                 )
 * 
 *         partitions = partitions or [_true] * len(paths)             # <<<<<<<<<<<<<<
 * 
 *         if len(paths) != len(partitions):
*/
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_partitions); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
  if (!__pyx_t_8) {
  } else {
    __Pyx_INCREF(__pyx_v_partitions);
    __pyx_t_5 = __pyx_v_partitions;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_7 = PyObject_Length(__pyx_v_paths); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1231, __pyx_L1_error)
  __pyx_t_6 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) {
      __Pyx_INCREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
      __Pyx_GIVEREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_6, __pyx_temp, ((PyObject *)__pyx_v_7pyarrow_8_dataset__true)) != (0)) __PYX_ERR(0, 1231, __pyx_L1_error);
    }
  }
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = __pyx_t_6;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_L8_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_partitions, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/_dataset.pyx":1233
 *         partitions = partitions or [_true] * len(paths)
 * 
 *         if len(paths) != len(partitions):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'The number of files resulting from paths_or_selector '
*/
  __pyx_t_7 = PyObject_Length(__pyx_v_paths); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1233, __pyx_L1_error)
  __pyx_t_13 = PyObject_Length(__pyx_v_partitions); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1233, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != __pyx_t_13);
  if (unlikely(__pyx_t_8)) {

    /* "pyarrow/_dataset.pyx":1234
 * 
 *         if len(paths) != len(partitions):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'The number of files resulting from paths_or_selector '
 *                 'must be equal to the number of partitions.'
*/
    __pyx_t_6 = NULL;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_The_number_of_files_resulting_fr};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L1_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(0, 1234, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1233
 *         partitions = partitions or [_true] * len(paths)
 * 
 *         if len(paths) != len(partitions):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'The number of files resulting from paths_or_selector '
*/
  }

  /* "pyarrow/_dataset.pyx":1239
 *             )
 * 
 *         fragments = [             # <<<<<<<<<<<<<<
 *             format.make_fragment(path, filesystem, partitions[i])
 *             for i, path in enumerate(paths)
*/
  { /* enter inner scope */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1239, __pyx_L13_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
    __pyx_t_6 = __pyx_mstate_global->__pyx_int_0;

    /* "pyarrow/_dataset.pyx":1241
 *         fragments = [
 *             format.make_fragment(path, filesystem, partitions[i])
 *             for i, path in enumerate(paths)             # <<<<<<<<<<<<<<
 *         ]
 *         return FileSystemDataset(fragments, schema, format,
*/
    if (likely(PyList_CheckExact(__pyx_v_paths)) || PyTuple_CheckExact(__pyx_v_paths)) {
      __pyx_t_11 = __pyx_v_paths; __Pyx_INCREF(__pyx_t_11);
      __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_paths); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1241, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1241, __pyx_L13_error)
    }
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_11))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __pyx_L13_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_11, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_13;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __pyx_L13_error)
            #endif
            if (__pyx_t_13 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13));
          #else
          __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_13);
          #endif
          ++__pyx_t_13;
        }
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L13_error)
      } else {
        __pyx_t_2 = __pyx_t_14(__pyx_t_11);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1241, __pyx_L13_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_path, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_i, __pyx_t_6);
      __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_t_6, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6);
      __pyx_t_6 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/_dataset.pyx":1240
 * 
 *         fragments = [
 *             format.make_fragment(path, filesystem, partitions[i])             # <<<<<<<<<<<<<<
 *             for i, path in enumerate(paths)
 *         ]
*/
      __pyx_t_4 = __pyx_v_format;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_partitions, __pyx_8genexpr1__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1240, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_8genexpr1__pyx_v_path, __pyx_v_filesystem, __pyx_t_9};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_fragment, __pyx_callargs+__pyx_t_12, (4-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1239, __pyx_L13_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/_dataset.pyx":1241
 *         fragments = [
 *             format.make_fragment(path, filesystem, partitions[i])
 *             for i, path in enumerate(paths)             # <<<<<<<<<<<<<<
 *         ]
 *         return FileSystemDataset(fragments, schema, format,
*/
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i); __pyx_8genexpr1__pyx_v_i = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_path); __pyx_8genexpr1__pyx_v_path = 0;
    goto __pyx_L17_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i); __pyx_8genexpr1__pyx_v_i = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_path); __pyx_8genexpr1__pyx_v_path = 0;
    goto __pyx_L1_error;
    __pyx_L17_exit_scope:;
  } /* exit inner scope */
  __pyx_v_fragments = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/_dataset.pyx":1243
 *             for i, path in enumerate(paths)
 *         ]
 *         return FileSystemDataset(fragments, schema, format,             # <<<<<<<<<<<<<<
 *                                  filesystem, root_partition)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = NULL;

  /* "pyarrow/_dataset.pyx":1244
 *         ]
 *         return FileSystemDataset(fragments, schema, format,
 *                                  filesystem, root_partition)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_12 = 1;
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_fragments, __pyx_v_schema, __pyx_v_format, __pyx_v_filesystem, __pyx_v_root_partition};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_callargs+__pyx_t_12, (6-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1194
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDataset.from_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_fragments);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_partitions);
  __Pyx_XDECREF(__pyx_v_root_partition);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1246
 *                                  filesystem, root_partition)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def files(self):
 *         """List of the files"""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5files_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5files_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_5files___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_5files___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self) {
  std::vector<std::string>  __pyx_v_files;
  std::string __pyx_8genexpr2__pyx_v_f;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> ::iterator __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1249
 *     def files(self):
 *         """List of the files"""
 *         cdef vector[c_string] files = self.filesystem_dataset.files()             # <<<<<<<<<<<<<<
 *         return [frombytes(f) for f in files]
 * 
*/
  __pyx_v_files = __pyx_v_self->filesystem_dataset->files();

  /* "pyarrow/_dataset.pyx":1250
 *         """List of the files"""
 *         cdef vector[c_string] files = self.filesystem_dataset.files()
 *         return [frombytes(f) for f in files]             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_files.begin();
    for (; __pyx_t_2 != __pyx_v_files.end(); ++__pyx_t_2) {
      __pyx_t_3 = *__pyx_t_2;
      __pyx_8genexpr2__pyx_v_f = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_8genexpr2__pyx_v_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1250, __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/_dataset.pyx":1246
 *                                  filesystem, root_partition)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def files(self):
 *         """List of the files"""
*/

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

/* "pyarrow/_dataset.pyx":1252
 *         return [frombytes(f) for f in files]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         """The FileFormat of this source."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_6format_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_6format___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FileSystemDataset_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1255
 *     def format(self):
 *         """The FileFormat of this source."""
 *         return FileFormat.wrap(self.filesystem_dataset.format())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(__pyx_v_self->filesystem_dataset->format()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1252
 *         return [frombytes(f) for f in files]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         """The FileFormat of this source."""
*/

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

/* "pyarrow/_dataset.pyx":1260
 * cdef class FileWriteOptions(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":1261
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1260
 * cdef class FileWriteOptions(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":1263
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.c_options = sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp) {

  /* "pyarrow/_dataset.pyx":1264
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.c_options = sp.get()
 * 
*/
  __pyx_v_self->wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":1265
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         self.wrapped = sp
 *         self.c_options = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->c_options = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":1263
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.c_options = sp.get()
*/

  /* function exit code */
}

/* "pyarrow/_dataset.pyx":1267
 *         self.c_options = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFileWriteOptions]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_16FileWriteOptions_wrap(std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":1269
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CFileWriteOptions]& sp):
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1272
 * 
 *         classes = {
 *             'csv': CsvFileWriteOptions,             # <<<<<<<<<<<<<<
 *             'ipc': IpcFileWriteOptions,
 *             'parquet': _get_parquet_symbol('ParquetFileWriteOptions'),
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_csv, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions)) < (0)) __PYX_ERR(0, 1272, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1273
 *         classes = {
 *             'csv': CsvFileWriteOptions,
 *             'ipc': IpcFileWriteOptions,             # <<<<<<<<<<<<<<
 *             'parquet': _get_parquet_symbol('ParquetFileWriteOptions'),
 *         }
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ipc, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions)) < (0)) __PYX_ERR(0, 1272, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1274
 *             'csv': CsvFileWriteOptions,
 *             'ipc': IpcFileWriteOptions,
 *             'parquet': _get_parquet_symbol('ParquetFileWriteOptions'),             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ParquetFileWriteOptions};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_parquet, __pyx_t_3) < (0)) __PYX_ERR(0, 1272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_classes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1277
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             raise TypeError(type_name)
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_class_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1278
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  __pyx_t_6 = (__pyx_v_class_ == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_dataset.pyx":1279
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             raise TypeError(type_name)             # <<<<<<<<<<<<<<
 * 
 *         cdef FileWriteOptions self = class_.__new__(class_)
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_type_name};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1279, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1278
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1281
 *             raise TypeError(type_name)
 * 
 *         cdef FileWriteOptions self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_3 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_class_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions))))) __PYX_ERR(0, 1281, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1282
 * 
 *         cdef FileWriteOptions self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1283
 *         cdef FileWriteOptions self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1267
 *         self.c_options = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFileWriteOptions]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FileWriteOptions.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1285
 *         return self
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         return FileFormat.wrap(self.c_options.format())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_6format_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_6format___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1287
 *     @property
 *     def format(self):
 *         return FileFormat.wrap(self.c_options.format())             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CFileWriteOptions] unwrap(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(__pyx_v_self->c_options->format()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1285
 *         return self
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         return FileFormat.wrap(self.c_options.format())
*/

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

/* "pyarrow/_dataset.pyx":1289
 *         return FileFormat.wrap(self.c_options.format())
 * 
 *     cdef inline shared_ptr[CFileWriteOptions] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_r;

  /* "pyarrow/_dataset.pyx":1290
 * 
 *     cdef inline shared_ptr[CFileWriteOptions] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1289
 *         return FileFormat.wrap(self.c_options.format())
 * 
 *     cdef inline shared_ptr[CFileWriteOptions] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__, "FileWriteOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_wrapped_cann, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileWriteOptions.__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.c_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__, "FileWriteOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileWriteOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_wrapped_cann, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":1295
 * cdef class FileFormat(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_10FileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_10FileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat___init__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_10FileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":1296
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1295
 * cdef class FileFormat(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":1298
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.format = sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_10FileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp) {

  /* "pyarrow/_dataset.pyx":1299
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.format = sp.get()
 * 
*/
  __pyx_v_self->wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":1300
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         self.wrapped = sp
 *         self.format = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->format = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":1298
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.format = sp.get()
*/

  /* function exit code */
}

/* "pyarrow/_dataset.pyx":1302
 *         self.format = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFileFormat]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":1304
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CFileFormat]& sp):
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1307
 * 
 *         classes = {
 *             'ipc': IpcFileFormat,             # <<<<<<<<<<<<<<
 *             'csv': CsvFileFormat,
 *             'json': JsonFileFormat,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ipc, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat)) < (0)) __PYX_ERR(0, 1307, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1308
 *         classes = {
 *             'ipc': IpcFileFormat,
 *             'csv': CsvFileFormat,             # <<<<<<<<<<<<<<
 *             'json': JsonFileFormat,
 *             'parquet': _get_parquet_symbol('ParquetFileFormat'),
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_csv, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat)) < (0)) __PYX_ERR(0, 1307, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1309
 *             'ipc': IpcFileFormat,
 *             'csv': CsvFileFormat,
 *             'json': JsonFileFormat,             # <<<<<<<<<<<<<<
 *             'parquet': _get_parquet_symbol('ParquetFileFormat'),
 *             'orc': _get_orc_fileformat(),
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_json, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat)) < (0)) __PYX_ERR(0, 1307, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1310
 *             'csv': CsvFileFormat,
 *             'json': JsonFileFormat,
 *             'parquet': _get_parquet_symbol('ParquetFileFormat'),             # <<<<<<<<<<<<<<
 *             'orc': _get_orc_fileformat(),
 *         }
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ParquetFileFormat};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_parquet, __pyx_t_3) < (0)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":1311
 *             'json': JsonFileFormat,
 *             'parquet': _get_parquet_symbol('ParquetFileFormat'),
 *             'orc': _get_orc_fileformat(),             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_orc_fileformat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orc, __pyx_t_3) < (0)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_classes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1314
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             raise TypeError(type_name)
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_class_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1315
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  __pyx_t_6 = (__pyx_v_class_ == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_dataset.pyx":1316
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             raise TypeError(type_name)             # <<<<<<<<<<<<<<
 * 
 *         cdef FileFormat self = class_.__new__(class_)
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_type_name};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1316, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1315
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1318
 *             raise TypeError(type_name)
 * 
 *         cdef FileFormat self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_3 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_class_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat))))) __PYX_ERR(0, 1318, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1319
 * 
 *         cdef FileFormat self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1319, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1320
 *         cdef FileFormat self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef WrittenFile _finish_write(self, path, base_dir,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1302
 *         self.format = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFileFormat]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1322
 *         return self
 * 
 *     cdef WrittenFile _finish_write(self, path, base_dir,             # <<<<<<<<<<<<<<
 *                                    CFileWriter* file_writer):
 *         parquet_metadata = None
*/

static struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_f_7pyarrow_8_dataset_10FileFormat__finish_write(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_path, CYTHON_UNUSED PyObject *__pyx_v_base_dir, arrow::dataset::FileWriter *__pyx_v_file_writer) {
  PyObject *__pyx_v_parquet_metadata = NULL;
  int64_t __pyx_v_size;
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_finish_write", 0);

  /* "pyarrow/_dataset.pyx":1324
 *     cdef WrittenFile _finish_write(self, path, base_dir,
 *                                    CFileWriter* file_writer):
 *         parquet_metadata = None             # <<<<<<<<<<<<<<
 *         size = GetResultValue(file_writer.GetBytesWritten())
 *         return WrittenFile(path, parquet_metadata, size)
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_parquet_metadata = Py_None;

  /* "pyarrow/_dataset.pyx":1325
 *                                    CFileWriter* file_writer):
 *         parquet_metadata = None
 *         size = GetResultValue(file_writer.GetBytesWritten())             # <<<<<<<<<<<<<<
 *         return WrittenFile(path, parquet_metadata, size)
 * 
*/
  __pyx_t_1 = arrow::py::GetResultValue<int64_t>(__pyx_v_file_writer->GetBytesWritten()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1325, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "pyarrow/_dataset.pyx":1326
 *         parquet_metadata = None
 *         size = GetResultValue(file_writer.GetBytesWritten())
 *         return WrittenFile(path, parquet_metadata, size)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CFileFormat] unwrap(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = NULL;
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_path, __pyx_v_parquet_metadata, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_WrittenFile, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1322
 *         return self
 * 
 *     cdef WrittenFile _finish_write(self, path, base_dir,             # <<<<<<<<<<<<<<
 *                                    CFileWriter* file_writer):
 *         parquet_metadata = None
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat._finish_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parquet_metadata);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1328
 *         return WrittenFile(path, parquet_metadata, size)
 * 
 *     cdef inline shared_ptr[CFileFormat] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::FileFormat>  __pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::FileFormat>  __pyx_r;

  /* "pyarrow/_dataset.pyx":1329
 * 
 *     cdef inline shared_ptr[CFileFormat] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     def inspect(self, file, filesystem=None):
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1328
 *         return WrittenFile(path, parquet_metadata, size)
 * 
 *     cdef inline shared_ptr[CFileFormat] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1331
 *         return self.wrapped
 * 
 *     def inspect(self, file, filesystem=None):             # <<<<<<<<<<<<<<
 *         """
 *         Infer the schema of a file.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_3inspect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10FileFormat_2inspect, "FileFormat.inspect(self, file, filesystem=None)\n\nInfer the schema of a file.\n\nParameters\n----------\nfile : file-like object, path-like or str\n    The file or file path to infer a schema from.\nfilesystem : Filesystem, optional\n    If `filesystem` is given, `file` must be a string and specifies\n    the path of the file to read from the filesystem.\n\nReturns\n-------\nschema : Schema\n    The schema inferred from the file");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_10FileFormat_3inspect = {"inspect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_3inspect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_2inspect};
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_3inspect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_filesystem = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inspect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_file,&__pyx_mstate_global->__pyx_n_u_filesystem,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1331, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "inspect", 0) < (0)) __PYX_ERR(0, 1331, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("inspect", 0, 1, 2, i); __PYX_ERR(0, 1331, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1331, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_file = values[0];
    __pyx_v_filesystem = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inspect", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.inspect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_2inspect(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), __pyx_v_file, __pyx_v_filesystem);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_2inspect(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_filesystem) {
  arrow::dataset::FileSource __pyx_v_c_source;
  arrow::Result<std::shared_ptr< arrow::Schema> >  __pyx_v_c_result;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  arrow::dataset::FileSource __pyx_t_1;
  struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source __pyx_t_2;
  std::shared_ptr< arrow::Schema>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inspect", 0);

  /* "pyarrow/_dataset.pyx":1349
 *         """
 *         cdef:
 *             CFileSource c_source = _make_file_source(file, filesystem, file_size=None)             # <<<<<<<<<<<<<<
 *             CResult[shared_ptr[CSchema]] c_result
 *         with nogil:
*/
  if (!(likely(((__pyx_v_filesystem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_filesystem, __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem))))) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem);
  __pyx_t_2.file_size = Py_None;
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset__make_file_source(__pyx_v_file, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_v_c_source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":1351
 *             CFileSource c_source = _make_file_source(file, filesystem, file_size=None)
 *             CResult[shared_ptr[CSchema]] c_result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result = self.format.Inspect(c_source)
 *         c_schema = GetResultValue(c_result)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":1352
 *             CResult[shared_ptr[CSchema]] c_result
 *         with nogil:
 *             c_result = self.format.Inspect(c_source)             # <<<<<<<<<<<<<<
 *         c_schema = GetResultValue(c_result)
 *         return pyarrow_wrap_schema(move(c_schema))
*/
        __pyx_v_c_result = __pyx_v_self->format->Inspect(__pyx_v_c_source);
      }

      /* "pyarrow/_dataset.pyx":1351
 *             CFileSource c_source = _make_file_source(file, filesystem, file_size=None)
 *             CResult[shared_ptr[CSchema]] c_result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_result = self.format.Inspect(c_source)
 *         c_schema = GetResultValue(c_result)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":1353
 *         with nogil:
 *             c_result = self.format.Inspect(c_source)
 *         c_schema = GetResultValue(c_result)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
*/
  __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr< arrow::Schema> >(__pyx_v_c_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1353, __pyx_L1_error)
  __pyx_v_c_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":1354
 *             c_result = self.format.Inspect(c_source)
 *         c_schema = GetResultValue(c_result)
 *         return pyarrow_wrap_schema(move(c_schema))             # <<<<<<<<<<<<<<
 * 
 *     def make_fragment(self, file, filesystem=None,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(cython_std::move<std::shared_ptr< arrow::Schema> >(__pyx_v_c_schema)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1331
 *         return self.wrapped
 * 
 *     def inspect(self, file, filesystem=None):             # <<<<<<<<<<<<<<
 *         """
 *         Infer the schema of a file.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.inspect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_5make_fragment(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10FileFormat_4make_fragment, "FileFormat.make_fragment(self, file, filesystem=None, Expression partition_expression=None, *, file_size=None)\n\nMake a FileFragment from a given file.\n\nParameters\n----------\nfile : file-like object, path-like or str\n    The file or file path to make a fragment from.\nfilesystem : Filesystem, optional\n    If `filesystem` is given, `file` must be a string and specifies\n    the path of the file to read from the filesystem.\npartition_expression : Expression, optional\n    An expression that is guaranteed true for all rows in the fragment.  Allows\n    fragment to be potentially skipped while scanning with a filter.\nfile_size : int, optional\n    The size of the file in bytes. Can improve performance with high-latency filesystems\n    when file size needs to be known before reading.\n\nReturns\n-------\nfragment : Fragment\n    The file fragment");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_10FileFormat_5make_fragment = {"make_fragment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_5make_fragment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_4make_fragment};
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_5make_fragment(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_filesystem = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression = 0;
  PyObject *__pyx_v_file_size = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_fragment (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_file,&__pyx_mstate_global->__pyx_n_u_filesystem,&__pyx_mstate_global->__pyx_n_u_partition_expression,&__pyx_mstate_global->__pyx_n_u_file_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "make_fragment", 0) < (0)) __PYX_ERR(0, 1356, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1357
 * 
 *     def make_fragment(self, file, filesystem=None,
 *                       Expression partition_expression=None,             # <<<<<<<<<<<<<<
 *                       *, file_size=None):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1358
 *     def make_fragment(self, file, filesystem=None,
 *                       Expression partition_expression=None,
 *                       *, file_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a FileFragment from a given file.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("make_fragment", 0, 1, 3, i); __PYX_ERR(0, 1356, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1356, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1357
 * 
 *     def make_fragment(self, file, filesystem=None,
 *                       Expression partition_expression=None,             # <<<<<<<<<<<<<<
 *                       *, file_size=None):
 *         """
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1358
 *     def make_fragment(self, file, filesystem=None,
 *                       Expression partition_expression=None,
 *                       *, file_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a FileFragment from a given file.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_file = values[0];
    __pyx_v_filesystem = values[1];
    __pyx_v_partition_expression = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    __pyx_v_file_size = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_fragment", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 1356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.make_fragment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_partition_expression), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "partition_expression", 0))) __PYX_ERR(0, 1357, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_4make_fragment(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), __pyx_v_file, __pyx_v_filesystem, __pyx_v_partition_expression, __pyx_v_file_size);

  /* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_4make_fragment(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_filesystem, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression, PyObject *__pyx_v_file_size) {
  arrow::dataset::FileSource __pyx_v_c_source;
  std::shared_ptr<arrow::dataset::Fragment>  __pyx_v_c_fragment;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  arrow::dataset::FileSource __pyx_t_2;
  struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source __pyx_t_3;
  arrow::compute::Expression __pyx_t_4;
  std::shared_ptr<arrow::dataset::FileFragment>  __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_fragment", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_partition_expression);

  /* "pyarrow/_dataset.pyx":1381
 *             The file fragment
 *         """
 *         if partition_expression is None:             # <<<<<<<<<<<<<<
 *             partition_expression = _true
 *         c_source = _make_file_source(file, filesystem, file_size)
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_partition_expression) == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":1382
 *         """
 *         if partition_expression is None:
 *             partition_expression = _true             # <<<<<<<<<<<<<<
 *         c_source = _make_file_source(file, filesystem, file_size)
 *         c_fragment = <shared_ptr[CFragment]> GetResultValue(
*/
    __Pyx_INCREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
    __Pyx_DECREF_SET(__pyx_v_partition_expression, __pyx_v_7pyarrow_8_dataset__true);

    /* "pyarrow/_dataset.pyx":1381
 *             The file fragment
 *         """
 *         if partition_expression is None:             # <<<<<<<<<<<<<<
 *             partition_expression = _true
 *         c_source = _make_file_source(file, filesystem, file_size)
*/
  }

  /* "pyarrow/_dataset.pyx":1383
 *         if partition_expression is None:
 *             partition_expression = _true
 *         c_source = _make_file_source(file, filesystem, file_size)             # <<<<<<<<<<<<<<
 *         c_fragment = <shared_ptr[CFragment]> GetResultValue(
 *             self.format.MakeFragment(move(c_source),
*/
  if (!(likely(((__pyx_v_filesystem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_filesystem, __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem))))) __PYX_ERR(0, 1383, __pyx_L1_error)
  __pyx_t_3.__pyx_n = 2;
  __pyx_t_3.filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem);
  __pyx_t_3.file_size = __pyx_v_file_size;
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset__make_file_source(__pyx_v_file, &__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
  __pyx_v_c_source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1386
 *         c_fragment = <shared_ptr[CFragment]> GetResultValue(
 *             self.format.MakeFragment(move(c_source),
 *                                      partition_expression.unwrap(),             # <<<<<<<<<<<<<<
 *                                      <shared_ptr[CSchema]>nullptr))
 *         return Fragment.wrap(move(c_fragment))
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *)__pyx_v_partition_expression->__pyx_vtab)->unwrap(__pyx_v_partition_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1384
 *             partition_expression = _true
 *         c_source = _make_file_source(file, filesystem, file_size)
 *         c_fragment = <shared_ptr[CFragment]> GetResultValue(             # <<<<<<<<<<<<<<
 *             self.format.MakeFragment(move(c_source),
 *                                      partition_expression.unwrap(),
*/
  __pyx_t_5 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::FileFragment> >(__pyx_v_self->format->MakeFragment(cython_std::move<arrow::dataset::FileSource>(__pyx_v_c_source), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), ((std::shared_ptr< arrow::Schema> )nullptr))); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_v_c_fragment = ((std::shared_ptr<arrow::dataset::Fragment> )__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1388
 *                                      partition_expression.unwrap(),
 *                                      <shared_ptr[CSchema]>nullptr))
 *         return Fragment.wrap(move(c_fragment))             # <<<<<<<<<<<<<<
 * 
 *     def make_write_options(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_7pyarrow_8_dataset_8Fragment_wrap(cython_std::move<std::shared_ptr<arrow::dataset::Fragment> >(__pyx_v_c_fragment)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.make_fragment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_partition_expression);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1390
 *         return Fragment.wrap(move(c_fragment))
 * 
 *     def make_write_options(self):             # <<<<<<<<<<<<<<
 *         sp_write_options = self.format.DefaultWriteOptions()
 *         if sp_write_options.get() == nullptr:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_7make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10FileFormat_6make_write_options, "FileFormat.make_write_options(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_10FileFormat_7make_write_options = {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_7make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_6make_write_options};
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_7make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_write_options (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("make_write_options", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("make_write_options", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_6make_write_options(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_6make_write_options(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_v_sp_write_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_write_options", 0);

  /* "pyarrow/_dataset.pyx":1391
 * 
 *     def make_write_options(self):
 *         sp_write_options = self.format.DefaultWriteOptions()             # <<<<<<<<<<<<<<
 *         if sp_write_options.get() == nullptr:
 *             # DefaultWriteOptions() may return `nullptr` which means that
*/
  __pyx_v_sp_write_options = __pyx_v_self->format->DefaultWriteOptions();

  /* "pyarrow/_dataset.pyx":1392
 *     def make_write_options(self):
 *         sp_write_options = self.format.DefaultWriteOptions()
 *         if sp_write_options.get() == nullptr:             # <<<<<<<<<<<<<<
 *             # DefaultWriteOptions() may return `nullptr` which means that
 *             # the format does not yet support writing datasets.
*/
  __pyx_t_1 = (__pyx_v_sp_write_options.get() == nullptr);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_dataset.pyx":1395
 *             # DefaultWriteOptions() may return `nullptr` which means that
 *             # the format does not yet support writing datasets.
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Writing datasets not yet implemented for this file format."
 *             )
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Writing_datasets_not_yet_impleme};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1395, __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(0, 1395, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":1392
 *     def make_write_options(self):
 *         sp_write_options = self.format.DefaultWriteOptions()
 *         if sp_write_options.get() == nullptr:             # <<<<<<<<<<<<<<
 *             # DefaultWriteOptions() may return `nullptr` which means that
 *             # the format does not yet support writing datasets.
*/
  }

  /* "pyarrow/_dataset.pyx":1398
 *                 "Writing datasets not yet implemented for this file format."
 *             )
 *         return FileWriteOptions.wrap(sp_write_options)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_wrap(__pyx_v_sp_write_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1390
 *         return Fragment.wrap(move(c_fragment))
 * 
 *     def make_write_options(self):             # <<<<<<<<<<<<<<
 *         sp_write_options = self.format.DefaultWriteOptions()
 *         if sp_write_options.get() == nullptr:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.make_write_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1400
 *         return FileWriteOptions.wrap(sp_write_options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return frombytes(self.format.type_name())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_15default_extname_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_15default_extname_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_15default_extname___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_15default_extname___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1402
 *     @property
 *     def default_extname(self):
 *         return frombytes(self.format.type_name())             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->format->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1400
 *         return FileWriteOptions.wrap(sp_write_options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return frombytes(self.format.type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.default_extname.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1404
 *         return frombytes(self.format.type_name())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_fragment_scan_options(self):
 *         dfso = FragmentScanOptions.wrap(
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self) {
  PyObject *__pyx_v_dfso = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1406
 *     @property
 *     def default_fragment_scan_options(self):
 *         dfso = FragmentScanOptions.wrap(             # <<<<<<<<<<<<<<
 *             self.wrapped.get().default_fragment_scan_options)
 *         # CsvFileFormat stores a Python-specific encoding field that needs
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_wrap(__pyx_v_self->wrapped.get()->default_fragment_scan_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dfso = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1410
 *         # CsvFileFormat stores a Python-specific encoding field that needs
 *         # to be restored because it does not exist in the C++ struct
 *         if isinstance(self, CsvFileFormat):             # <<<<<<<<<<<<<<
 *             if self._read_options_py is not None:
 *                 dfso.read_options = self._read_options_py
*/
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":1411
 *         # to be restored because it does not exist in the C++ struct
 *         if isinstance(self, CsvFileFormat):
 *             if self._read_options_py is not None:             # <<<<<<<<<<<<<<
 *                 dfso.read_options = self._read_options_py
 *         return dfso
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options_py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __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;
    if (__pyx_t_2) {

      /* "pyarrow/_dataset.pyx":1412
 *         if isinstance(self, CsvFileFormat):
 *             if self._read_options_py is not None:
 *                 dfso.read_options = self._read_options_py             # <<<<<<<<<<<<<<
 *         return dfso
 * 
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options_py); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_dfso, __pyx_mstate_global->__pyx_n_u_read_options, __pyx_t_1) < (0)) __PYX_ERR(0, 1412, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/_dataset.pyx":1411
 *         # to be restored because it does not exist in the C++ struct
 *         if isinstance(self, CsvFileFormat):
 *             if self._read_options_py is not None:             # <<<<<<<<<<<<<<
 *                 dfso.read_options = self._read_options_py
 *         return dfso
*/
    }

    /* "pyarrow/_dataset.pyx":1410
 *         # CsvFileFormat stores a Python-specific encoding field that needs
 *         # to be restored because it does not exist in the C++ struct
 *         if isinstance(self, CsvFileFormat):             # <<<<<<<<<<<<<<
 *             if self._read_options_py is not None:
 *                 dfso.read_options = self._read_options_py
*/
  }

  /* "pyarrow/_dataset.pyx":1413
 *             if self._read_options_py is not None:
 *                 dfso.read_options = self._read_options_py
 *         return dfso             # <<<<<<<<<<<<<<
 * 
 *     @default_fragment_scan_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dfso);
  __pyx_r = __pyx_v_dfso;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1404
 *         return frombytes(self.format.type_name())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_fragment_scan_options(self):
 *         dfso = FragmentScanOptions.wrap(
*/

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

/* "pyarrow/_dataset.pyx":1415
 *         return dfso
 * 
 *     @default_fragment_scan_options.setter             # <<<<<<<<<<<<<<
 *     def default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options is None:
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "options", 0))) __PYX_ERR(0, 1416, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_options));

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

static int __pyx_pf_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/_dataset.pyx":1417
 *     @default_fragment_scan_options.setter
 *     def default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options is None:             # <<<<<<<<<<<<<<
 *             self.wrapped.get().default_fragment_scan_options =\
 *                 <shared_ptr[CFragmentScanOptions]>nullptr
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_options) == Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":1418
 *     def default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options is None:
 *             self.wrapped.get().default_fragment_scan_options =\             # <<<<<<<<<<<<<<
 *                 <shared_ptr[CFragmentScanOptions]>nullptr
 *         else:
*/
    __pyx_v_self->wrapped.get()->default_fragment_scan_options = ((std::shared_ptr<arrow::dataset::FragmentScanOptions> )nullptr);

    /* "pyarrow/_dataset.pyx":1417
 *     @default_fragment_scan_options.setter
 *     def default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options is None:             # <<<<<<<<<<<<<<
 *             self.wrapped.get().default_fragment_scan_options =\
 *                 <shared_ptr[CFragmentScanOptions]>nullptr
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":1421
 *                 <shared_ptr[CFragmentScanOptions]>nullptr
 *         else:
 *             self._set_default_fragment_scan_options(options)             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat *)__pyx_v_self->__pyx_vtab)->_set_default_fragment_scan_options(__pyx_v_self, __pyx_v_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":1415
 *         return dfso
 * 
 *     @default_fragment_scan_options.setter             # <<<<<<<<<<<<<<
 *     def default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options is None:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.default_fragment_scan_options.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1423
 *             self._set_default_fragment_scan_options(options)
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         raise ValueError(f"Cannot set fragment scan options for "
 *                          f"'{options.type_name}' on {self.__class__.__name__}")
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_10FileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options) {
  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[4];
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_default_fragment_scan_options", 0);

  /* "pyarrow/_dataset.pyx":1424
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         raise ValueError(f"Cannot set fragment scan options for "             # <<<<<<<<<<<<<<
 *                          f"'{options.type_name}' on {self.__class__.__name__}")
 * 
*/
  __pyx_t_2 = NULL;

  /* "pyarrow/_dataset.pyx":1425
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         raise ValueError(f"Cannot set fragment scan options for "
 *                          f"'{options.type_name}' on {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_type_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cannot_set_fragment_scan_options;
  __pyx_t_6[1] = __pyx_t_4;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_on_2;
  __pyx_t_6[3] = __pyx_t_3;

  /* "pyarrow/_dataset.pyx":1424
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         raise ValueError(f"Cannot set fragment scan options for "             # <<<<<<<<<<<<<<
 *                          f"'{options.type_name}' on {self.__class__.__name__}")
 * 
*/
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 1424, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1423
 *             self._set_default_fragment_scan_options(options)
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         raise ValueError(f"Cannot set fragment scan options for "
 *                          f"'{options.type_name}' on {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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat._set_default_fragment_scan_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1427
 *                          f"'{options.type_name}' on {self.__class__.__name__}")
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_9__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_9__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_8__eq__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_8__eq__(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/_dataset.pyx":1428
 * 
 *     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/_dataset.pyx":1429
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return False
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/_dataset.pyx":1428
 * 
 *     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;

    /* "pyarrow/_dataset.pyx":1430
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);

      /* "pyarrow/_dataset.pyx":1431
 *             return self.equals(other)
 *         except TypeError:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_dataset.pyx":1428
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
*/
    __pyx_L5_except_error:;
    __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/_dataset.pyx":1427
 *                          f"'{options.type_name}' on {self.__class__.__name__}")
 * 
 *     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_AddTraceback("pyarrow._dataset.FileFormat.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__, "FileFormat.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_format_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.__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.format,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__, "FileFormat.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileFormat.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_format_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":1437
 *     """Fragment of data from a Dataset."""
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_8Fragment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_8Fragment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment___init__(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_8Fragment___init__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":1438
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1437
 *     """Fragment of data from a Dataset."""
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":1440
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.fragment = sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_8Fragment_init(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp) {

  /* "pyarrow/_dataset.pyx":1441
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.fragment = sp.get()
 * 
*/
  __pyx_v_self->wrapped = ((arrow::py::SharedPtrNoGIL<arrow::dataset::Fragment> )__pyx_v_sp);

  /* "pyarrow/_dataset.pyx":1442
 *     cdef void init(self, const shared_ptr[CFragment]& sp):
 *         self.wrapped = sp
 *         self.fragment = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->fragment = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":1440
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.fragment = sp.get()
*/

  /* function exit code */
}

/* "pyarrow/_dataset.pyx":1444
 *         self.fragment = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFragment]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_8Fragment_wrap(std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":1446
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CFragment]& sp):
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1451
 *             # IpcFileFormat, CsvFileFormat, JsonFileFormat and OrcFileFormat do not have
 *             # corresponding subclasses of FileFragment
 *             'ipc': FileFragment,             # <<<<<<<<<<<<<<
 *             'csv': FileFragment,
 *             'json': FileFragment,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ipc, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment)) < (0)) __PYX_ERR(0, 1451, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1452
 *             # corresponding subclasses of FileFragment
 *             'ipc': FileFragment,
 *             'csv': FileFragment,             # <<<<<<<<<<<<<<
 *             'json': FileFragment,
 *             'orc': FileFragment,
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_csv, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment)) < (0)) __PYX_ERR(0, 1451, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1453
 *             'ipc': FileFragment,
 *             'csv': FileFragment,
 *             'json': FileFragment,             # <<<<<<<<<<<<<<
 *             'orc': FileFragment,
 *             'parquet': _get_parquet_symbol('ParquetFileFragment'),
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_json, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment)) < (0)) __PYX_ERR(0, 1451, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1454
 *             'csv': FileFragment,
 *             'json': FileFragment,
 *             'orc': FileFragment,             # <<<<<<<<<<<<<<
 *             'parquet': _get_parquet_symbol('ParquetFileFragment'),
 *         }
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orc, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment)) < (0)) __PYX_ERR(0, 1451, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1455
 *             'json': FileFragment,
 *             'orc': FileFragment,
 *             'parquet': _get_parquet_symbol('ParquetFileFragment'),             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ParquetFileFragment};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_parquet, __pyx_t_3) < (0)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_classes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1458
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             class_ = Fragment
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_class_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1459
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             class_ = Fragment
 * 
*/
  __pyx_t_6 = (__pyx_v_class_ == Py_None);
  if (__pyx_t_6) {

    /* "pyarrow/_dataset.pyx":1460
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             class_ = Fragment             # <<<<<<<<<<<<<<
 * 
 *         cdef Fragment self = class_.__new__(class_)
*/
    __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment);
    __Pyx_DECREF_SET(__pyx_v_class_, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment));

    /* "pyarrow/_dataset.pyx":1459
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             class_ = Fragment
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":1462
 *             class_ = Fragment
 * 
 *         cdef Fragment self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_3 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_class_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment))))) __PYX_ERR(0, 1462, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1463
 * 
 *         cdef Fragment self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1464
 *         cdef Fragment self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CFragment] unwrap(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1444
 *         self.fragment = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFragment]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1466
 *         return self
 * 
 *     cdef inline shared_ptr[CFragment] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::Fragment>  __pyx_f_7pyarrow_8_dataset_8Fragment_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Fragment>  __pyx_r;

  /* "pyarrow/_dataset.pyx":1467
 * 
 *     cdef inline shared_ptr[CFragment] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1466
 *         return self
 * 
 *     cdef inline shared_ptr[CFragment] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1469
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def physical_schema(self):
 *         """Return the physical schema of this Fragment. This schema can be
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_15physical_schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_15physical_schema_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_15physical_schema___get__(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_15physical_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self) {
  arrow::Result<std::shared_ptr< arrow::Schema> >  __pyx_v_maybe_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1475
 *         cdef:
 *             CResult[shared_ptr[CSchema]] maybe_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             maybe_schema = self.fragment.ReadPhysicalSchema()
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":1476
 *             CResult[shared_ptr[CSchema]] maybe_schema
 *         with nogil:
 *             maybe_schema = self.fragment.ReadPhysicalSchema()             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))
 * 
*/
        __pyx_v_maybe_schema = __pyx_v_self->fragment->ReadPhysicalSchema();
      }

      /* "pyarrow/_dataset.pyx":1475
 *         cdef:
 *             CResult[shared_ptr[CSchema]] maybe_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             maybe_schema = self.fragment.ReadPhysicalSchema()
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":1477
 *         with nogil:
 *             maybe_schema = self.fragment.ReadPhysicalSchema()
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Schema> >(__pyx_v_maybe_schema); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1477, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1469
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def physical_schema(self):
 *         """Return the physical schema of this Fragment. This schema can be
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.physical_schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1479
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_expression(self):
 *         """An Expression which evaluates to true for all data viewed by this
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_20partition_expression_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_20partition_expression_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_20partition_expression___get__(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_20partition_expression___get__(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":1484
 *         Fragment.
 *         """
 *         return Expression.wrap(self.fragment.partition_expression())             # <<<<<<<<<<<<<<
 * 
 *     def scanner(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_8_compute_Expression->wrap(__pyx_v_self->fragment->partition_expression()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1479
 *         return pyarrow_wrap_schema(GetResultValue(maybe_schema))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_expression(self):
 *         """An Expression which evaluates to true for all data viewed by this
*/

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

/* "pyarrow/_dataset.pyx":1486
 *         return Expression.wrap(self.fragment.partition_expression())
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 Schema schema=None,
 *                 object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_3scanner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_2scanner, "Fragment.scanner(self, Schema schema=None, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nBuild a scan operation against the fragment.\n\nData is not loaded immediately. Instead, this produces a Scanner,\nwhich exposes further operations (e.g. loading all data as a\ntable, counting rows).\n\nParameters\n----------\nschema : Schema\n    Schema to use for scanning. This is used to unify a Fragment to\n    its Dataset's schema. If not specified this will use the\n    Fragment's physical schema which might differ for each Fragment.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata fo""und in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nscanner : Scanner");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_3scanner = {"scanner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_3scanner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_2scanner};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_3scanner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scanner (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1486, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scanner", 0) < (0)) __PYX_ERR(0, 1486, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1487
 * 
 *     def scanner(self,
 *                 Schema schema=None,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1488
 *     def scanner(self,
 *                 Schema schema=None,
 *                 object columns=None,             # <<<<<<<<<<<<<<
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1489
 *                 Schema schema=None,
 *                 object columns=None,
 *                 Expression filter=None,             # <<<<<<<<<<<<<<
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1493
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1496
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Build a scan operation against the fragment.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1487
 * 
 *     def scanner(self,
 *                 Schema schema=None,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1488
 *     def scanner(self,
 *                 Schema schema=None,
 *                 object columns=None,             # <<<<<<<<<<<<<<
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1489
 *                 Schema schema=None,
 *                 object columns=None,
 *                 Expression filter=None,             # <<<<<<<<<<<<<<
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1493
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1496
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Build a scan operation against the fragment.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__21;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__22;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1492, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__23;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1494, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1494
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,             # <<<<<<<<<<<<<<
 *                 bint cache_metadata=True,
 *                 MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1495
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
 *                 bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                 MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scanner", 0, 0, 10, __pyx_nargs); __PYX_ERR(0, 1486, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.scanner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 1487, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1489, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1493, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1496, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_2scanner(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_schema, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1486
 *         return Expression.wrap(self.fragment.partition_expression())
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 Schema schema=None,
 *                 object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_2scanner(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scanner", 0);

  /* "pyarrow/_dataset.pyx":1563
 *         scanner : Scanner
 *         """
 *         return Scanner.from_fragment(             # <<<<<<<<<<<<<<
 *             self,
 *             schema=schema,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1568
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":1569
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1570
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1572
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1573
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         )
*/
  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1574
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 10 : 0)] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, ((PyObject *)__pyx_v_schema), __pyx_t_9, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_9, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_9, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_3, __pyx_t_9, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_4, __pyx_t_9, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_5, __pyx_t_9, __pyx_callargs+2, 5) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_9, __pyx_callargs+2, 6) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_6, __pyx_t_9, __pyx_callargs+2, 7) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_7, __pyx_t_9, __pyx_callargs+2, 8) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_9, __pyx_callargs+2, 9) < (0)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_fragment, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1486
 *         return Expression.wrap(self.fragment.partition_expression())
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 Schema schema=None,
 *                 object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.scanner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1577
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    Schema schema=None,
 *                    object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_5to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_4to_batches, "Fragment.to_batches(self, Schema schema=None, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nRead the fragment as materialized record batches.\n\nParameters\n----------\nschema : Schema, optional\n    Concrete schema to use for scanning.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n   "" called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nrecord_batches : iterator of RecordBatch");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_5to_batches = {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_5to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_4to_batches};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_5to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1577, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_batches", 0) < (0)) __PYX_ERR(0, 1577, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1578
 * 
 *     def to_batches(self,
 *                    Schema schema=None,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1579
 *     def to_batches(self,
 *                    Schema schema=None,
 *                    object columns=None,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1580
 *                    Schema schema=None,
 *                    object columns=None,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1584
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1587
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the fragment as materialized record batches.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1578
 * 
 *     def to_batches(self,
 *                    Schema schema=None,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1579
 *     def to_batches(self,
 *                    Schema schema=None,
 *                    object columns=None,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1580
 *                    Schema schema=None,
 *                    object columns=None,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1584
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1587
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Read the fragment as materialized record batches.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__24;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__25;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__26;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1585, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1585
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,             # <<<<<<<<<<<<<<
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1586, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1586
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                    MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_batches", 0, 0, 10, __pyx_nargs); __PYX_ERR(0, 1577, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.to_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_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 1578, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1580, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1584, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1587, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_4to_batches(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_schema, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1577
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    Schema schema=None,
 *                    object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_4to_batches(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_batches", 0);

  /* "pyarrow/_dataset.pyx":1648
 *         record_batches : iterator of RecordBatch
 *         """
 *         return Scanner.from_fragment(             # <<<<<<<<<<<<<<
 *             self,
 *             schema=schema,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1660
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).to_batches()             # <<<<<<<<<<<<<<
 * 
 *     def to_table(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1653
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1654
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1655
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1657
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":1658
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).to_batches()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":1659
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).to_batches()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 10 : 0)] = {__pyx_t_4, ((PyObject *)__pyx_v_self)};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, ((PyObject *)__pyx_v_schema), __pyx_t_11, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+2, 5) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+2, 6) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+2, 7) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+2, 8) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+2, 9) < (0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_from_fragment, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_batches, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1577
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    Schema schema=None,
 *                    object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1662
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  Schema schema=None,
 *                  object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_7to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_6to_table, "Fragment.to_table(self, Schema schema=None, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nConvert this Fragment into a Table.\n\nUse this convenience utility with care. This will serially materialize\nthe Scan result in memory before creating the Table.\n\nParameters\n----------\nschema : Schema, optional\n    Concrete schema to use for scanning.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row coun""t for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ntable : Table");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_7to_table = {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_7to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_6to_table};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_7to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1662, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_table", 0) < (0)) __PYX_ERR(0, 1662, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1663
 * 
 *     def to_table(self,
 *                  Schema schema=None,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1664
 *     def to_table(self,
 *                  Schema schema=None,
 *                  object columns=None,             # <<<<<<<<<<<<<<
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1665
 *                  Schema schema=None,
 *                  object columns=None,
 *                  Expression filter=None,             # <<<<<<<<<<<<<<
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1669
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1672
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert this Fragment into a Table.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1662, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1663
 * 
 *     def to_table(self,
 *                  Schema schema=None,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":1664
 *     def to_table(self,
 *                  Schema schema=None,
 *                  object columns=None,             # <<<<<<<<<<<<<<
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1665
 *                  Schema schema=None,
 *                  object columns=None,
 *                  Expression filter=None,             # <<<<<<<<<<<<<<
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1669
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1672
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert this Fragment into a Table.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__27;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__28;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__29;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1670, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1670
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,             # <<<<<<<<<<<<<<
 *                  bint cache_metadata=True,
 *                  MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1671
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
 *                  bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                  MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_table", 0, 0, 10, __pyx_nargs); __PYX_ERR(0, 1662, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.to_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 1663, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1665, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1669, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1672, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_6to_table(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_schema, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1662
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  Schema schema=None,
 *                  object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_6to_table(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_table", 0);

  /* "pyarrow/_dataset.pyx":1736
 *         table : Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             schema=schema,
 *             columns=columns,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1747
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).to_table()             # <<<<<<<<<<<<<<
 * 
 *     def take(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1740
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1741
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1742
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1744
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":1745
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).to_table()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":1746
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).to_table()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 10 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, ((PyObject *)__pyx_v_schema), __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 9) < (0)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_to_table, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1662
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  Schema schema=None,
 *                  object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.to_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1749
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_9take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_8take, "Fragment.take(self, indices, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nSelect rows of data by index.\n\nParameters\n----------\nindices : Array or array-like\n    The indices of row to select in the dataset.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their s""ize.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nTable");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_9take = {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_9take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_8take};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_9take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1749, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "take", 0) < (0)) __PYX_ERR(0, 1749, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1751
 *     def take(self,
 *              object indices,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1752
 *              object indices,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1756
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1759
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("take", 0, 1, 10, i); __PYX_ERR(0, 1749, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1749, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1751
 *     def take(self,
 *              object indices,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1752
 *              object indices,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1756
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1759
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_indices = values[0];
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__30;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__31;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__32;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1757, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1757
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,             # <<<<<<<<<<<<<<
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1758
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
 *              bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *              MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 1749, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1752, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1756, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1759, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_8take(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_indices, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1749
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_8take(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take", 0);

  /* "pyarrow/_dataset.pyx":1820
 *         Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1830
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).take(indices)             # <<<<<<<<<<<<<<
 * 
 *     def head(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1823
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1824
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1825
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1827
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":1828
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).take(indices)
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":1829
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).take(indices)
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1830
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).take(indices)             # <<<<<<<<<<<<<<
 * 
 *     def head(self,
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_indices};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_take, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1749
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1832
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_11head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_10head, "Fragment.head(self, int num_rows, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nLoad the first N rows of the fragment.\n\nParameters\n----------\nnum_rows : int\n    The number of rows to load.\ncolumns : list of str, default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readah""ead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\nTable");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_11head = {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_11head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_10head};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_11head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num_rows;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("head (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_num_rows,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "head", 0) < (0)) __PYX_ERR(0, 1832, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1834
 *     def head(self,
 *              int num_rows,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1835
 *              int num_rows,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1839
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1842
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the fragment.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("head", 0, 1, 10, i); __PYX_ERR(0, 1832, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1832, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1834
 *     def head(self,
 *              int num_rows,
 *              object columns=None,             # <<<<<<<<<<<<<<
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":1835
 *              int num_rows,
 *              object columns=None,
 *              Expression filter=None,             # <<<<<<<<<<<<<<
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1839
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *              bint use_threads=True,
 *              bint cache_metadata=True,
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1842
 *              bint use_threads=True,
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the fragment.
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_num_rows = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_num_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L3_error)
    __pyx_v_columns = values[1];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[2]);
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1836, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__33;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__34;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__35;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1840, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1840
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,             # <<<<<<<<<<<<<<
 *              bint cache_metadata=True,
 *              MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1841
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
 *              bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *              MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("head", 0, 1, 10, __pyx_nargs); __PYX_ERR(0, 1832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1835, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1839, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1842, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_10head(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_num_rows, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1832
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_10head(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, int __pyx_v_num_rows, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("head", 0);

  /* "pyarrow/_dataset.pyx":1903
 *         Table
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             filter=filter,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1913
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).head(num_rows)             # <<<<<<<<<<<<<<
 * 
 *     def count_rows(self,
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1906
 *             columns=columns,
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1907
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1908
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1910
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":1911
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).head(num_rows)
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":1912
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).head(num_rows)
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 9 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 8) < (0)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1913
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).head(num_rows)             # <<<<<<<<<<<<<<
 * 
 *     def count_rows(self,
*/
  __pyx_t_11 = __Pyx_PyLong_From_int(__pyx_v_num_rows); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_head, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1832
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1915
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_13count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_12count_rows, "Fragment.count_rows(self, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nCount rows matching the scanner filter.\n\nParameters\n----------\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.\n\nReturns\n-------\ncount : int");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_13count_rows = {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_13count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_12count_rows};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_13count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count_rows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1915, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "count_rows", 0) < (0)) __PYX_ERR(0, 1915, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":1916
 * 
 *     def count_rows(self,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1920
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1923
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1915, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":1916
 * 
 *     def count_rows(self,
 *                    Expression filter=None,             # <<<<<<<<<<<<<<
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":1920
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":1923
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[0]);
    if (values[1]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__36;
    }
    if (values[2]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__37;
    }
    if (values[3]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1919, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__38;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[4]);
    if (values[5]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1921, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1921
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,             # <<<<<<<<<<<<<<
 *                    bint cache_metadata=True,
 *                    MemoryPool memory_pool=None):
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[6]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1922, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":1922
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
 *                    bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                    MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[7]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count_rows", 0, 0, 8, __pyx_nargs); __PYX_ERR(0, 1915, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.count_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 1916, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 1920, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 1923, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_12count_rows(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":1915
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_12count_rows(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, 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;
  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;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count_rows", 0);

  /* "pyarrow/_dataset.pyx":1963
 *         count : int
 *         """
 *         return self.scanner(             # <<<<<<<<<<<<<<
 *             filter=filter,
 *             batch_size=batch_size,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":1972
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
 *         ).count_rows()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1965
 *         return self.scanner(
 *             filter=filter,
 *             batch_size=batch_size,             # <<<<<<<<<<<<<<
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":1966
 *             filter=filter,
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
*/
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":1967
 *             batch_size=batch_size,
 *             batch_readahead=batch_readahead,
 *             fragment_readahead=fragment_readahead,             # <<<<<<<<<<<<<<
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":1969
 *             fragment_readahead=fragment_readahead,
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,             # <<<<<<<<<<<<<<
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":1970
 *             fragment_scan_options=fragment_scan_options,
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool
 *         ).count_rows()
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":1971
 *             use_threads=use_threads,
 *             cache_metadata=cache_metadata,
 *             memory_pool=memory_pool             # <<<<<<<<<<<<<<
 *         ).count_rows()
 * 
*/
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 8 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_filter, ((PyObject *)__pyx_v_filter), __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options), __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 6) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool), __pyx_t_11, __pyx_callargs+1, 7) < (0)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_count_rows, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1915
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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_11);
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.count_rows", __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.fragment,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_14__reduce_cython__, "Fragment.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_14__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_14__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_fragment_self_wrapped_canno, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.__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.fragment,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8Fragment_16__setstate_cython__, "Fragment.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_8Fragment_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_16__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_8Fragment_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Fragment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8Fragment_16__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_8Fragment_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_fragment_self_wrapped_canno, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":1978
 *     """A Fragment representing a data file."""
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):             # <<<<<<<<<<<<<<
 *         Fragment.init(self, sp)
 *         self.file_fragment = <CFileFragment*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_12FileFragment_init(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self, std::shared_ptr<arrow::dataset::Fragment>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":1979
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):
 *         Fragment.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.file_fragment = <CFileFragment*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_8Fragment_init(((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1979, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1980
 *     cdef void init(self, const shared_ptr[CFragment]& sp):
 *         Fragment.init(self, sp)
 *         self.file_fragment = <CFileFragment*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_v_self->file_fragment = ((arrow::dataset::FileFragment *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":1978
 *     """A Fragment representing a data file."""
 * 
 *     cdef void init(self, const shared_ptr[CFragment]& sp):             # <<<<<<<<<<<<<<
 *         Fragment.init(self, sp)
 *         self.file_fragment = <CFileFragment*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileFragment.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":1982
 *         self.file_fragment = <CFileFragment*> sp.get()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_name = frombytes(self.fragment.type_name())
 *         if type_name != "parquet":
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment___repr__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment___repr__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_typ = NULL;
  PyObject *__pyx_v_partition_dict = NULL;
  PyObject *__pyx_v_partition = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_key = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_val = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11[3];
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_dataset.pyx":1983
 * 
 *     def __repr__(self):
 *         type_name = frombytes(self.fragment.type_name())             # <<<<<<<<<<<<<<
 *         if type_name != "parquet":
 *             typ = f" type={type_name}"
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->__pyx_base.fragment->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1984
 *     def __repr__(self):
 *         type_name = frombytes(self.fragment.type_name())
 *         if type_name != "parquet":             # <<<<<<<<<<<<<<
 *             typ = f" type={type_name}"
 *         else:
*/
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_type_name, __pyx_mstate_global->__pyx_n_u_parquet, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1984, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "pyarrow/_dataset.pyx":1985
 *         type_name = frombytes(self.fragment.type_name())
 *         if type_name != "parquet":
 *             typ = f" type={type_name}"             # <<<<<<<<<<<<<<
 *         else:
 *             # parquet has a subclass -> type embedded in class name
*/
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_type_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_typ = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":1984
 *     def __repr__(self):
 *         type_name = frombytes(self.fragment.type_name())
 *         if type_name != "parquet":             # <<<<<<<<<<<<<<
 *             typ = f" type={type_name}"
 *         else:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":1988
 *         else:
 *             # parquet has a subclass -> type embedded in class name
 *             typ = ""             # <<<<<<<<<<<<<<
 *         partition_dict = get_partition_keys(self.partition_expression)
 *         partition = ", ".join(
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__39);
    __pyx_v_typ = __pyx_mstate_global->__pyx_kp_u__39;
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":1989
 *             # parquet has a subclass -> type embedded in class name
 *             typ = ""
 *         partition_dict = get_partition_keys(self.partition_expression)             # <<<<<<<<<<<<<<
 *         partition = ", ".join(
 *             [f"{key}={val}" for key, val in partition_dict.items()]
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_partition_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partition_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_partition_dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":1990
 *             typ = ""
 *         partition_dict = get_partition_keys(self.partition_expression)
 *         partition = ", ".join(             # <<<<<<<<<<<<<<
 *             [f"{key}={val}" for key, val in partition_dict.items()]
 *         )
*/
  { /* enter inner scope */

    /* "pyarrow/_dataset.pyx":1991
 *         partition_dict = get_partition_keys(self.partition_expression)
 *         partition = ", ".join(
 *             [f"{key}={val}" for key, val in partition_dict.items()]             # <<<<<<<<<<<<<<
 *         )
 *         if partition:
*/
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    if (unlikely(__pyx_v_partition_dict == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 1991, __pyx_L6_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_partition_dict, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_1, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1991, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_key, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_val, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_8genexpr3__pyx_v_key, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_8genexpr3__pyx_v_val, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11[0] = __pyx_t_1;
      __pyx_t_11[1] = __pyx_mstate_global->__pyx_kp_u__41;
      __pyx_t_11[2] = __pyx_t_2;
      __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
      if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1991, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1991, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key); __pyx_8genexpr3__pyx_v_key = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val); __pyx_8genexpr3__pyx_v_val = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key); __pyx_8genexpr3__pyx_v_key = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val); __pyx_8genexpr3__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */

  /* "pyarrow/_dataset.pyx":1990
 *             typ = ""
 *         partition_dict = get_partition_keys(self.partition_expression)
 *         partition = ", ".join(             # <<<<<<<<<<<<<<
 *             [f"{key}={val}" for key, val in partition_dict.items()]
 *         )
*/
  __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__40, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_partition = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1993
 *             [f"{key}={val}" for key, val in partition_dict.items()]
 *         )
 *         if partition:             # <<<<<<<<<<<<<<
 *             partition = f" partition=[{partition}]"
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
*/
  if (__pyx_v_partition == Py_None) __pyx_t_6 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_partition);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1993, __pyx_L1_error)
    __pyx_t_6 = (__pyx_temp != 0);
  }

  if (__pyx_t_6) {

    /* "pyarrow/_dataset.pyx":1994
 *         )
 *         if partition:
 *             partition = f" partition=[{partition}]"             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
 * 
*/
    __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_partition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_partition;
    __pyx_t_11[1] = __pyx_t_4;
    __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__42;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_partition, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":1993
 *             [f"{key}={val}" for key, val in partition_dict.items()]
 *         )
 *         if partition:             # <<<<<<<<<<<<<<
 *             partition = f" partition=[{partition}]"
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
*/
  }

  /* "pyarrow/_dataset.pyx":1995
 *         if partition:
 *             partition = f" partition=[{partition}]"
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_path_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_partition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_dataset;
  __pyx_t_13[1] = __pyx_t_3;
  __pyx_t_13[2] = __pyx_v_typ;
  __pyx_t_13[3] = __pyx_mstate_global->__pyx_kp_u_path;
  __pyx_t_13[4] = __pyx_t_12;
  __pyx_t_13[5] = __pyx_t_4;
  __pyx_t_13[6] = __pyx_mstate_global->__pyx_kp_u__43;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_13, 7, 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_typ) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_typ) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1982
 *         self.file_fragment = <CFileFragment*> sp.get()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         type_name = frombytes(self.fragment.type_name())
 *         if type_name != "parquet":
*/

  /* 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_12);
  __Pyx_AddTraceback("pyarrow._dataset.FileFragment.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_typ);
  __Pyx_XDECREF(__pyx_v_partition_dict);
  __Pyx_XDECREF(__pyx_v_partition);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_key);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":1997
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         buffer = self.buffer
 *         return self.format.make_fragment, (
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12FileFragment_2__reduce__, "FileFragment.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12FileFragment_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12FileFragment_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12FileFragment_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  PyObject *__pyx_v_buffer = 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;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":1998
 * 
 *     def __reduce__(self):
 *         buffer = self.buffer             # <<<<<<<<<<<<<<
 *         return self.format.make_fragment, (
 *             self.path if buffer is None else buffer,
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffer = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":1999
 *     def __reduce__(self):
 *         buffer = self.buffer
 *         return self.format.make_fragment, (             # <<<<<<<<<<<<<<
 *             self.path if buffer is None else buffer,
 *             self.filesystem,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_make_fragment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2000
 *         buffer = self.buffer
 *         return self.format.make_fragment, (
 *             self.path if buffer is None else buffer,             # <<<<<<<<<<<<<<
 *             self.filesystem,
 *             self.partition_expression
*/
  __pyx_t_3 = (__pyx_v_buffer == Py_None);
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_path_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_v_buffer);
    __pyx_t_1 = __pyx_v_buffer;
  }

  /* "pyarrow/_dataset.pyx":2001
 *         return self.format.make_fragment, (
 *             self.path if buffer is None else buffer,
 *             self.filesystem,             # <<<<<<<<<<<<<<
 *             self.partition_expression
 *         )
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_filesystem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":2002
 *             self.path if buffer is None else buffer,
 *             self.filesystem,
 *             self.partition_expression             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partition_expression); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":2000
 *         buffer = self.buffer
 *         return self.format.make_fragment, (
 *             self.path if buffer is None else buffer,             # <<<<<<<<<<<<<<
 *             self.filesystem,
 *             self.partition_expression
*/
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2000, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 2000, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 2000, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;

  /* "pyarrow/_dataset.pyx":1999
 *     def __reduce__(self):
 *         buffer = self.buffer
 *         return self.format.make_fragment, (             # <<<<<<<<<<<<<<
 *             self.path if buffer is None else buffer,
 *             self.filesystem,
*/
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6) != (0)) __PYX_ERR(0, 1999, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":1997
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         buffer = self.buffer
 *         return self.format.make_fragment, (
*/

  /* 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_6);
  __Pyx_AddTraceback("pyarrow._dataset.FileFragment.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buffer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2005
 *         )
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *         """
 *         Open a NativeFile of the buffer or file viewed by this fragment.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_5open(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12FileFragment_4open, "FileFragment.open(self)\n\nOpen a NativeFile of the buffer or file viewed by this fragment.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12FileFragment_5open = {"open", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12FileFragment_5open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12FileFragment_4open};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_5open(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("open", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("open", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_4open(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_4open(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_v_c_filesystem;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_v_opened;
  std::string __pyx_v_c_path;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  std::shared_ptr< arrow::io::RandomAccessFile>  __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pyarrow/_dataset.pyx":2013
 *             shared_ptr[CRandomAccessFile] opened
 *             c_string c_path
 *             NativeFile out = NativeFile()             # <<<<<<<<<<<<<<
 * 
 *         # Handle each of the cases in _make_file_source
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_NativeFile, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2016
 * 
 *         # Handle each of the cases in _make_file_source
 *         if self.buffer is not None:             # <<<<<<<<<<<<<<
 *             return pa.BufferReader(self.buffer)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":2017
 *         # Handle each of the cases in _make_file_source
 *         if self.buffer is not None:
 *             return pa.BufferReader(self.buffer)             # <<<<<<<<<<<<<<
 * 
 *         if self.file_fragment.source().filesystem() != nullptr:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BufferReader); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":2016
 * 
 *         # Handle each of the cases in _make_file_source
 *         if self.buffer is not None:             # <<<<<<<<<<<<<<
 *             return pa.BufferReader(self.buffer)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2019
 *             return pa.BufferReader(self.buffer)
 * 
 *         if self.file_fragment.source().filesystem() != nullptr:             # <<<<<<<<<<<<<<
 *             c_path = tobytes(self.file_fragment.source().path())
 *             with nogil:
*/
  __pyx_t_4 = ((__pyx_v_self->file_fragment->source().filesystem() != nullptr) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":2020
 * 
 *         if self.file_fragment.source().filesystem() != nullptr:
 *             c_path = tobytes(self.file_fragment.source().path())             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 c_filesystem = self.file_fragment.source().filesystem()
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->file_fragment->source().path()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_path = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_dataset.pyx":2021
 *         if self.file_fragment.source().filesystem() != nullptr:
 *             c_path = tobytes(self.file_fragment.source().path())
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 c_filesystem = self.file_fragment.source().filesystem()
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))
*/
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_dataset.pyx":2022
 *             c_path = tobytes(self.file_fragment.source().path())
 *             with nogil:
 *                 c_filesystem = self.file_fragment.source().filesystem()             # <<<<<<<<<<<<<<
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))
 *         else:
*/
          __pyx_v_c_filesystem = __pyx_v_self->file_fragment->source().filesystem();

          /* "pyarrow/_dataset.pyx":2023
 *             with nogil:
 *                 c_filesystem = self.file_fragment.source().filesystem()
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
*/
          __pyx_t_8 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::RandomAccessFile> >(__pyx_v_c_filesystem.get()->OpenInputFile(__pyx_v_c_path)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2023, __pyx_L6_error)
          __pyx_v_opened = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);
        }

        /* "pyarrow/_dataset.pyx":2021
 *         if self.file_fragment.source().filesystem() != nullptr:
 *             c_path = tobytes(self.file_fragment.source().path())
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 c_filesystem = self.file_fragment.source().filesystem()
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L7;
          }
          __pyx_L6_error: {
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L1_error;
          }
          __pyx_L7:;
        }
    }

    /* "pyarrow/_dataset.pyx":2019
 *             return pa.BufferReader(self.buffer)
 * 
 *         if self.file_fragment.source().filesystem() != nullptr:             # <<<<<<<<<<<<<<
 *             c_path = tobytes(self.file_fragment.source().path())
 *             with nogil:
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":2025
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 opened = GetResultValue(self.file_fragment.source().Open())
 * 
*/
  /*else*/ {
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_dataset.pyx":2026
 *         else:
 *             with nogil:
 *                 opened = GetResultValue(self.file_fragment.source().Open())             # <<<<<<<<<<<<<<
 * 
 *         out.set_random_access_file(opened)
*/
          __pyx_t_8 = arrow::py::GetResultValue<std::shared_ptr< arrow::io::RandomAccessFile> >(__pyx_v_self->file_fragment->source().Open()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 2026, __pyx_L9_error)
          __pyx_v_opened = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);
        }

        /* "pyarrow/_dataset.pyx":2025
 *                 opened = GetResultValue(c_filesystem.get().OpenInputFile(c_path))
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 opened = GetResultValue(self.file_fragment.source().Open())
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L10;
          }
          __pyx_L9_error: {
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
    }
  }
  __pyx_L4:;

  /* "pyarrow/_dataset.pyx":2028
 *                 opened = GetResultValue(self.file_fragment.source().Open())
 * 
 *         out.set_random_access_file(opened)             # <<<<<<<<<<<<<<
 *         out.is_readable = True
 *         return out
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_out->__pyx_vtab)->set_random_access_file(__pyx_v_out, __pyx_v_opened); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2029
 * 
 *         out.set_random_access_file(opened)
 *         out.is_readable = True             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_v_out->is_readable = 1;

  /* "pyarrow/_dataset.pyx":2030
 *         out.set_random_access_file(opened)
 *         out.is_readable = True
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2005
 *         )
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *         """
 *         Open a NativeFile of the buffer or file viewed by this fragment.
*/

  /* 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._dataset.FileFragment.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/_dataset.pyx":2032
 *         return out
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def path(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_4path_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_4path___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_4path___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2038
 *         file. If instead it views a buffer, this will be "<Buffer>".
 *         """
 *         return frombytes(self.file_fragment.source().path())             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->file_fragment->source().path()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2032
 *         return out
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def path(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_AddTraceback("pyarrow._dataset.FileFragment.path.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2040
 *         return frombytes(self.file_fragment.source().path())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def filesystem(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_10filesystem_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_10filesystem_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_10filesystem___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_10filesystem___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_v_c_fs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2048
 *         cdef:
 *             shared_ptr[CFileSystem] c_fs
 *         c_fs = self.file_fragment.source().filesystem()             # <<<<<<<<<<<<<<
 * 
 *         if c_fs.get() == nullptr:
*/
  __pyx_v_c_fs = __pyx_v_self->file_fragment->source().filesystem();

  /* "pyarrow/_dataset.pyx":2050
 *         c_fs = self.file_fragment.source().filesystem()
 * 
 *         if c_fs.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  __pyx_t_1 = (__pyx_v_c_fs.get() == nullptr);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":2051
 * 
 *         if c_fs.get() == nullptr:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         return FileSystem.wrap(c_fs)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":2050
 *         c_fs = self.file_fragment.source().filesystem()
 * 
 *         if c_fs.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2053
 *             return None
 * 
 *         return FileSystem.wrap(c_fs)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_vtabptr_7pyarrow_3_fs_FileSystem->wrap(__pyx_v_c_fs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2040
 *         return frombytes(self.file_fragment.source().path())
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def filesystem(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.FileFragment.filesystem.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2055
 *         return FileSystem.wrap(c_fs)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def buffer(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_6buffer_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_6buffer_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_6buffer___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_6buffer___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_c_buffer;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2063
 *         cdef:
 *             shared_ptr[CBuffer] c_buffer
 *         c_buffer = self.file_fragment.source().buffer()             # <<<<<<<<<<<<<<
 * 
 *         if c_buffer.get() == nullptr:
*/
  __pyx_v_c_buffer = __pyx_v_self->file_fragment->source().buffer();

  /* "pyarrow/_dataset.pyx":2065
 *         c_buffer = self.file_fragment.source().buffer()
 * 
 *         if c_buffer.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  __pyx_t_1 = (__pyx_v_c_buffer.get() == nullptr);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":2066
 * 
 *         if c_buffer.get() == nullptr:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(c_buffer)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":2065
 *         c_buffer = self.file_fragment.source().buffer()
 * 
 *         if c_buffer.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2068
 *             return None
 * 
 *         return pyarrow_wrap_buffer(c_buffer)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_c_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2055
 *         return FileSystem.wrap(c_fs)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def buffer(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.FileFragment.buffer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2070
 *         return pyarrow_wrap_buffer(c_buffer)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12FileFragment_6format_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12FileFragment_6format___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12FileFragment_6format___get__(struct __pyx_obj_7pyarrow_8_dataset_FileFragment *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2075
 *         The format of the data file viewed by this fragment.
 *         """
 *         return FileFormat.wrap(self.file_fragment.format())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(__pyx_v_self->file_fragment->format()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2070
 *         return pyarrow_wrap_buffer(c_buffer)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def format(self):
 *         """
*/

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

/* "pyarrow/_dataset.pyx":2081
 *     """Scan options specific to a particular fragment and scan operation."""
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2082
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2081
 *     """Scan options specific to a particular fragment and scan operation."""
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2084
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 * 
*/

static void __pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp) {

  /* "pyarrow/_dataset.pyx":2085
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":2084
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 * 
*/

  /* function exit code */
}

/* "pyarrow/_dataset.pyx":2087
 *         self.wrapped = sp
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFragmentScanOptions]& sp):
 *         if not sp:
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_wrap(std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self = 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":2089
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CFragmentScanOptions]& sp):
 *         if not sp:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  __pyx_t_1 = ((!__pyx_v_sp) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":2090
 *     cdef wrap(const shared_ptr[CFragmentScanOptions]& sp):
 *         if not sp:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         type_name = frombytes(sp.get().type_name())
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":2089
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CFragmentScanOptions]& sp):
 *         if not sp:             # <<<<<<<<<<<<<<
 *             return None
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2092
 *             return None
 * 
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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 (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_type_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2095
 * 
 *         classes = {
 *             'csv': CsvFragmentScanOptions,             # <<<<<<<<<<<<<<
 *             'json': JsonFragmentScanOptions,
 *             'parquet': _get_parquet_symbol('ParquetFragmentScanOptions'),
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_csv, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions)) < (0)) __PYX_ERR(0, 2095, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2096
 *         classes = {
 *             'csv': CsvFragmentScanOptions,
 *             'json': JsonFragmentScanOptions,             # <<<<<<<<<<<<<<
 *             'parquet': _get_parquet_symbol('ParquetFragmentScanOptions'),
 *         }
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_json, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions)) < (0)) __PYX_ERR(0, 2095, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2097
 *             'csv': CsvFragmentScanOptions,
 *             'json': JsonFragmentScanOptions,
 *             'parquet': _get_parquet_symbol('ParquetFragmentScanOptions'),             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ParquetFragmentScanOptions};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_parquet, __pyx_t_4) < (0)) __PYX_ERR(0, 2095, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_classes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2100
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             raise TypeError(type_name)
*/
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_class_ = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2101
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  __pyx_t_1 = (__pyx_v_class_ == Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_dataset.pyx":2102
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             raise TypeError(type_name)             # <<<<<<<<<<<<<<
 * 
 *         cdef FragmentScanOptions self = class_.__new__(class_)
*/
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_type_name};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __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(0, 2102, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2101
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2104
 *             raise TypeError(type_name)
 * 
 *         cdef FragmentScanOptions self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_4 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_class_};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions))))) __PYX_ERR(0, 2104, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2105
 * 
 *         cdef FragmentScanOptions self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2105, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2106
 *         cdef FragmentScanOptions self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2087
 *         self.wrapped = sp
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CFragmentScanOptions]& sp):
 *         if not sp:
*/

  /* 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._dataset.FragmentScanOptions.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2108
 *         return self
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type_name(self):
 *         return frombytes(self.wrapped.get().type_name())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_9type_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_9type_name_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_9type_name___get__(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_9type_name___get__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2110
 *     @property
 *     def type_name(self):
 *         return frombytes(self.wrapped.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->wrapped.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2108
 *         return self
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type_name(self):
 *         return frombytes(self.wrapped.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.FragmentScanOptions.type_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2112
 *         return frombytes(self.wrapped.get().type_name())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_2__eq__(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_2__eq__(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/_dataset.pyx":2113
 * 
 *     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/_dataset.pyx":2114
 *     def __eq__(self, other):
 *         try:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return False
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_other};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2114, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/_dataset.pyx":2113
 * 
 *     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;

    /* "pyarrow/_dataset.pyx":2115
 *         try:
 *             return self.equals(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);

      /* "pyarrow/_dataset.pyx":2116
 *             return self.equals(other)
 *         except TypeError:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_dataset.pyx":2113
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
*/
    __pyx_L5_except_error:;
    __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/_dataset.pyx":2112
 *         return frombytes(self.wrapped.get().type_name())
 * 
 *     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_AddTraceback("pyarrow._dataset.FragmentScanOptions.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__, "FragmentScanOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_wrapped_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FragmentScanOptions.__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.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__, "FragmentScanOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FragmentScanOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_wrapped_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":2123
 *         CIpcFileWriteOptions* ipc_options
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2124
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2123
 *         CIpcFileWriteOptions* ipc_options
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2126
 *         _forbid_instantiation(self.__class__)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         out = IpcWriteOptions()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options___get__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2128
 *     @property
 *     def write_options(self):
 *         out = IpcWriteOptions()             # <<<<<<<<<<<<<<
 *         out.c_options = CIpcWriteOptions(deref(self.ipc_options.options))
 *         return out
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2129
 *     def write_options(self):
 *         out = IpcWriteOptions()
 *         out.c_options = CIpcWriteOptions(deref(self.ipc_options.options))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_v_out->c_options =  arrow::ipc::IpcWriteOptions((*__pyx_v_self->ipc_options->options));

  /* "pyarrow/_dataset.pyx":2130
 *         out = IpcWriteOptions()
 *         out.c_options = CIpcWriteOptions(deref(self.ipc_options.options))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     @write_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2126
 *         _forbid_instantiation(self.__class__)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         out = IpcWriteOptions()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileWriteOptions.write_options.__get__", __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/_dataset.pyx":2132
 *         return out
 * 
 *     @write_options.setter             # <<<<<<<<<<<<<<
 *     def write_options(self, IpcWriteOptions write_options not None):
 *         self.ipc_options.options.reset(
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_write_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_write_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_write_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions, 0, "write_options", 0))) __PYX_ERR(0, 2133, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_v_write_options));

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

static int __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_v_write_options) {
  int __pyx_r;

  /* "pyarrow/_dataset.pyx":2134
 *     @write_options.setter
 *     def write_options(self, IpcWriteOptions write_options not None):
 *         self.ipc_options.options.reset(             # <<<<<<<<<<<<<<
 *             new CIpcWriteOptions(write_options.c_options))
 * 
*/
  __pyx_v_self->ipc_options->options.reset(new  arrow::ipc::IpcWriteOptions(__pyx_v_write_options->c_options));

  /* "pyarrow/_dataset.pyx":2132
 *         return out
 * 
 *     @write_options.setter             # <<<<<<<<<<<<<<
 *     def write_options(self, IpcWriteOptions write_options not None):
 *         self.ipc_options.options.reset(
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2137
 *             new CIpcWriteOptions(write_options.c_options))
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         FileWriteOptions.init(self, sp)
 *         self.ipc_options = <CIpcFileWriteOptions*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_19IpcFileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2138
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         FileWriteOptions.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.ipc_options = <CIpcFileWriteOptions*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_init(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2138, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2139
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         FileWriteOptions.init(self, sp)
 *         self.ipc_options = <CIpcFileWriteOptions*> sp.get()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->ipc_options = ((arrow::dataset::IpcFileWriteOptions *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2137
 *             new CIpcWriteOptions(write_options.c_options))
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         FileWriteOptions.init(self, sp)
 *         self.ipc_options = <CIpcFileWriteOptions*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileWriteOptions.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__, "IpcFileWriteOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_ipc_options, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileWriteOptions.__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.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__, "IpcFileWriteOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileWriteOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_ipc_options, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":2144
 * cdef class IpcFileFormat(FileFormat):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat___init__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self) {
  int __pyx_r;
  arrow::dataset::IpcFileFormat *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2145
 * 
 *     def __init__(self):
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, IpcFileFormat other):
*/
  try {
    __pyx_t_1 = new arrow::dataset::IpcFileFormat();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2145, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), std::shared_ptr<arrow::dataset::FileFormat> (__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2145, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2144
 * cdef class IpcFileFormat(FileFormat):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileFormat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2147
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))
 * 
 *     def equals(self, IpcFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_2equals, "IpcFileFormat.equals(self, IpcFileFormat other)\n\nParameters\n----------\nother : pyarrow.dataset.IpcFileFormat\n\nReturns\n-------\nTrue");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_3equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_2equals};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_other = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2147, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equals", 0) < (0)) __PYX_ERR(0, 2147, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 2147, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2147, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2147, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileFormat.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat, 1, "other", 0))) __PYX_ERR(0, 2147, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_2equals(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_2equals(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/_dataset.pyx":2157
 *         True
 *         """
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def make_write_options(self, **kwargs):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2147
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))
 * 
 *     def equals(self, IpcFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

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

/* "pyarrow/_dataset.pyx":2159
 *         return True
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options, "IpcFileFormat.make_write_options(self, **kwargs)\n\nParameters\n----------\n**kwargs : dict\n\nReturns\n-------\npyarrow.ipc.IpcWriteOptions");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options = {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_write_options (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("make_write_options", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("make_write_options", __pyx_kwds) == -1)) return NULL;
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *__pyx_v_opts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_write_options", 0);

  /* "pyarrow/_dataset.pyx":2170
 *         """
 *         cdef IpcFileWriteOptions opts = \
 *             <IpcFileWriteOptions> FileFormat.make_write_options(self)             # <<<<<<<<<<<<<<
 *         opts.write_options = IpcWriteOptions(**kwargs)
 *         return opts
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_write_options, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_opts = ((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2171
 *         cdef IpcFileWriteOptions opts = \
 *             <IpcFileWriteOptions> FileFormat.make_write_options(self)
 *         opts.write_options = IpcWriteOptions(**kwargs)             # <<<<<<<<<<<<<<
 *         return opts
 * 
*/
  __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions), __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_opts), __pyx_mstate_global->__pyx_n_u_write_options, __pyx_t_1) < (0)) __PYX_ERR(0, 2171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2172
 *             <IpcFileWriteOptions> FileFormat.make_write_options(self)
 *         opts.write_options = IpcWriteOptions(**kwargs)
 *         return opts             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_opts);
  __pyx_r = ((PyObject *)__pyx_v_opts);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2159
 *         return True
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.IpcFileFormat.make_write_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_opts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2174
 *         return opts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return "arrow"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_15default_extname_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_15default_extname_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_15default_extname___get__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_15default_extname___get__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2176
 *     @property
 *     def default_extname(self):
 *         return "arrow"             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_arrow);
  __pyx_r = __pyx_mstate_global->__pyx_n_u_arrow;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2174
 *         return opts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return "arrow"
*/

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

/* "pyarrow/_dataset.pyx":2178
 *         return "arrow"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return IpcFileFormat, tuple()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__, "IpcFileFormat.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2179
 * 
 *     def __reduce__(self):
 *         return IpcFileFormat, tuple()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyTuple_Type), __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat)) != (0)) __PYX_ERR(0, 2179, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 2179, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2178
 *         return "arrow"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return IpcFileFormat, tuple()
 * 
*/

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

/* "pyarrow/_dataset.pyx":2184
 * cdef class FeatherFileFormat(IpcFileFormat):
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return "feather"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname___get__(((struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname___get__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2186
 *     @property
 *     def default_extname(self):
 *         return "feather"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_feather);
  __pyx_r = __pyx_mstate_global->__pyx_n_u_feather;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2184
 * cdef class FeatherFileFormat(IpcFileFormat):
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def default_extname(self):
 *         return "feather"
*/

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

/* "pyarrow/_dataset.pyx":2214
 *     __slots__ = ()
 * 
 *     def __init__(self, ParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_4_csv_ParseOptions *__pyx_v_parse_options = 0;
  PyObject *__pyx_v_default_fragment_scan_options = 0;
  struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options = 0;
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_parse_options,&__pyx_mstate_global->__pyx_n_u_default_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_convert_options,&__pyx_mstate_global->__pyx_n_u_read_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2214, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2215
 * 
 *     def __init__(self, ParseOptions parse_options=None,
 *                  default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":2216
 *     def __init__(self, ParseOptions parse_options=None,
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2217
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
 *         if parse_options is not None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2214
 *     __slots__ = ()
 * 
 *     def __init__(self, ParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2215
 * 
 *     def __init__(self, ParseOptions parse_options=None,
 *                  default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":2216
 *     def __init__(self, ParseOptions parse_options=None,
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2217
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
 *         if parse_options is not None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None));
    }
    __pyx_v_parse_options = ((struct __pyx_obj_7pyarrow_4_csv_ParseOptions *)values[0]);
    __pyx_v_default_fragment_scan_options = values[1];
    __pyx_v_convert_options = ((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)values[2]);
    __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 2214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parse_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ParseOptions, 1, "parse_options", 0))) __PYX_ERR(0, 2214, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_convert_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ConvertOptions, 1, "convert_options", 0))) __PYX_ERR(0, 2216, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ReadOptions, 1, "read_options", 0))) __PYX_ERR(0, 2217, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat___init__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self), __pyx_v_parse_options, __pyx_v_default_fragment_scan_options, __pyx_v_convert_options, __pyx_v_read_options);

  /* "pyarrow/_dataset.pyx":2214
 *     __slots__ = ()
 * 
 *     def __init__(self, ParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ParseOptions *__pyx_v_parse_options, PyObject *__pyx_v_default_fragment_scan_options, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  arrow::dataset::CsvFileFormat *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2218
 *                  ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))             # <<<<<<<<<<<<<<
 *         if parse_options is not None:
 *             self.parse_options = parse_options
*/
  try {
    __pyx_t_1 = new arrow::dataset::CsvFileFormat();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2218, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), std::shared_ptr<arrow::dataset::FileFormat> (__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2218, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2219
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
 *         if parse_options is not None:             # <<<<<<<<<<<<<<
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_parse_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2220
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
 *         if parse_options is not None:
 *             self.parse_options = parse_options             # <<<<<<<<<<<<<<
 *         if convert_options is not None or read_options is not None:
 *             if default_fragment_scan_options:
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options, ((PyObject *)__pyx_v_parse_options)) < (0)) __PYX_ERR(0, 2220, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2219
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CCsvFileFormat()))
 *         if parse_options is not None:             # <<<<<<<<<<<<<<
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:
*/
  }

  /* "pyarrow/_dataset.pyx":2221
 *         if parse_options is not None:
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:             # <<<<<<<<<<<<<<
 *             if default_fragment_scan_options:
 *                 raise ValueError('If `default_fragment_scan_options` is '
*/
  __pyx_t_3 = (((PyObject *)__pyx_v_convert_options) != Py_None);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_read_options) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2222
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:
 *             if default_fragment_scan_options:             # <<<<<<<<<<<<<<
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify convert_options '
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_default_fragment_scan_options); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2222, __pyx_L1_error)
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/_dataset.pyx":2223
 *         if convert_options is not None or read_options is not None:
 *             if default_fragment_scan_options:
 *                 raise ValueError('If `default_fragment_scan_options` is '             # <<<<<<<<<<<<<<
 *                                  'given, cannot specify convert_options '
 *                                  'or read_options')
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_If_default_fragment_scan_options};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2223, __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(0, 2223, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":2222
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:
 *             if default_fragment_scan_options:             # <<<<<<<<<<<<<<
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify convert_options '
*/
    }

    /* "pyarrow/_dataset.pyx":2226
 *                                  'given, cannot specify convert_options '
 *                                  'or read_options')
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 convert_options=convert_options, read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):
*/
    __pyx_t_5 = NULL;

    /* "pyarrow/_dataset.pyx":2227
 *                                  'or read_options')
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 convert_options=convert_options, read_options=read_options)             # <<<<<<<<<<<<<<
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
*/
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, NULL};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_convert_options, ((PyObject *)__pyx_v_convert_options), __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 2226, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_read_options, ((PyObject *)__pyx_v_read_options), __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 2226, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __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_4)) __PYX_ERR(0, 2226, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }

    /* "pyarrow/_dataset.pyx":2226
 *                                  'given, cannot specify convert_options '
 *                                  'or read_options')
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 convert_options=convert_options, read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, ((PyObject *)__pyx_t_4)) < (0)) __PYX_ERR(0, 2226, __pyx_L1_error)
    __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2221
 *         if parse_options is not None:
 *             self.parse_options = parse_options
 *         if convert_options is not None or read_options is not None:             # <<<<<<<<<<<<<<
 *             if default_fragment_scan_options:
 *                 raise ValueError('If `default_fragment_scan_options` is '
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":2228
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 convert_options=convert_options, read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 **default_fragment_scan_options)
*/
  __pyx_t_2 = PyDict_Check(__pyx_v_default_fragment_scan_options); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2230
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 **default_fragment_scan_options)             # <<<<<<<<<<<<<<
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
*/
    if (unlikely(__pyx_v_default_fragment_scan_options == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 2230, __pyx_L1_error)
    }
    if (likely(PyDict_CheckExact(__pyx_v_default_fragment_scan_options))) {
      __pyx_t_4 = PyDict_Copy(__pyx_v_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }

    /* "pyarrow/_dataset.pyx":2229
 *                 convert_options=convert_options, read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):
*/
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions), __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, __pyx_t_7) < (0)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/_dataset.pyx":2228
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 convert_options=convert_options, read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 **default_fragment_scan_options)
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":2231
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_default_fragment_scan_options, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2232
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options             # <<<<<<<<<<<<<<
 *         elif default_fragment_scan_options is not None:
 *             raise TypeError('`default_fragment_scan_options` must be either '
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, __pyx_v_default_fragment_scan_options) < (0)) __PYX_ERR(0, 2232, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2231
 *             self.default_fragment_scan_options = CsvFragmentScanOptions(
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":2233
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError('`default_fragment_scan_options` must be either '
 *                             'a dictionary or an instance of '
*/
  __pyx_t_2 = (__pyx_v_default_fragment_scan_options != Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":2234
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
 *             raise TypeError('`default_fragment_scan_options` must be either '             # <<<<<<<<<<<<<<
 *                             'a dictionary or an instance of '
 *                             'CsvFragmentScanOptions')
*/
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_default_fragment_scan_options_m};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 2234, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2233
 *         elif isinstance(default_fragment_scan_options, CsvFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError('`default_fragment_scan_options` must be either '
 *                             'a dictionary or an instance of '
*/
  }
  __pyx_L4:;

  /* "pyarrow/_dataset.pyx":2237
 *                             'a dictionary or an instance of '
 *                             'CsvFragmentScanOptions')
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self._read_options_py = read_options
 * 
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_read_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2238
 *                             'CsvFragmentScanOptions')
 *         if read_options is not None:
 *             self._read_options_py = read_options             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
*/
    __Pyx_INCREF((PyObject *)__pyx_v_read_options);
    __Pyx_GIVEREF((PyObject *)__pyx_v_read_options);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
    __pyx_v_self->_read_options_py = __pyx_v_read_options;

    /* "pyarrow/_dataset.pyx":2237
 *                             'a dictionary or an instance of '
 *                             'CsvFragmentScanOptions')
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self._read_options_py = read_options
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2214
 *     __slots__ = ()
 * 
 *     def __init__(self, ParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  default_fragment_scan_options=None,
 *                  ConvertOptions convert_options=None,
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2240
 *             self._read_options_py = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         FileFormat.init(self, sp)
 *         self.csv_format = <CCsvFileFormat*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_13CsvFileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2241
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         FileFormat.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.csv_format = <CCsvFileFormat*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_10FileFormat_init(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2241, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2242
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         FileFormat.init(self, sp)
 *         self.csv_format = <CCsvFileFormat*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def make_write_options(self, **kwargs):
*/
  __pyx_v_self->csv_format = ((arrow::dataset::CsvFileFormat *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2240
 *             self._read_options_py = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         FileFormat.init(self, sp)
 *         self.csv_format = <CCsvFileFormat*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":2244
 *         self.csv_format = <CCsvFileFormat*> sp.get()
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options, "CsvFileFormat.make_write_options(self, **kwargs)\n\nParameters\n----------\n**kwargs : dict\n\nReturns\n-------\npyarrow.csv.WriteOptions");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options = {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_write_options (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("make_write_options", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("make_write_options", __pyx_kwds) == -1)) return NULL;
    __pyx_v_kwargs = __Pyx_KwargsAsDict_FASTCALL(__pyx_kwds, __pyx_kwvalues);
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = PyDict_New();
    if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  }
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_opts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_write_options", 0);

  /* "pyarrow/_dataset.pyx":2255
 *         """
 *         cdef CsvFileWriteOptions opts = \
 *             <CsvFileWriteOptions> FileFormat.make_write_options(self)             # <<<<<<<<<<<<<<
 *         opts.write_options = WriteOptions(**kwargs)
 *         return opts
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_write_options, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_opts = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":2256
 *         cdef CsvFileWriteOptions opts = \
 *             <CsvFileWriteOptions> FileFormat.make_write_options(self)
 *         opts.write_options = WriteOptions(**kwargs)             # <<<<<<<<<<<<<<
 *         return opts
 * 
*/
  __pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_WriteOptions), __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_opts), __pyx_mstate_global->__pyx_n_u_write_options, __pyx_t_1) < (0)) __PYX_ERR(0, 2256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2257
 *             <CsvFileWriteOptions> FileFormat.make_write_options(self)
 *         opts.write_options = WriteOptions(**kwargs)
 *         return opts             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_opts);
  __pyx_r = ((PyObject *)__pyx_v_opts);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2244
 *         self.csv_format = <CCsvFileFormat*> sp.get()
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat.make_write_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_opts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2259
 *         return opts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def parse_options(self):
 *         return ParseOptions.wrap(self.csv_format.parse_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2261
 *     @property
 *     def parse_options(self):
 *         return ParseOptions.wrap(self.csv_format.parse_options)             # <<<<<<<<<<<<<<
 * 
 *     @parse_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_4_csv_ParseOptions->wrap(__pyx_v_self->csv_format->parse_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2259
 *         return opts
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def parse_options(self):
 *         return ParseOptions.wrap(self.csv_format.parse_options)
*/

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

/* "pyarrow/_dataset.pyx":2263
 *         return ParseOptions.wrap(self.csv_format.parse_options)
 * 
 *     @parse_options.setter             # <<<<<<<<<<<<<<
 *     def parse_options(self, ParseOptions parse_options not None):
 *         self.csv_format.parse_options = deref(parse_options.options)
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parse_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parse_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parse_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ParseOptions, 0, "parse_options", 0))) __PYX_ERR(0, 2264, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_4_csv_ParseOptions *)__pyx_v_parse_options));

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

static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ParseOptions *__pyx_v_parse_options) {
  int __pyx_r;

  /* "pyarrow/_dataset.pyx":2265
 *     @parse_options.setter
 *     def parse_options(self, ParseOptions parse_options not None):
 *         self.csv_format.parse_options = deref(parse_options.options)             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
*/
  __pyx_v_self->csv_format->parse_options = (*__pyx_v_parse_options->options);

  /* "pyarrow/_dataset.pyx":2263
 *         return ParseOptions.wrap(self.csv_format.parse_options)
 * 
 *     @parse_options.setter             # <<<<<<<<<<<<<<
 *     def parse_options(self, ParseOptions parse_options not None):
 *         self.csv_format.parse_options = deref(parse_options.options)
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2267
 *         self.csv_format.parse_options = deref(parse_options.options)
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         if options.type_name == 'csv':
 *             self.csv_format.default_fragment_scan_options = options.wrapped
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_13CsvFileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  std::shared_ptr<arrow::dataset::FragmentScanOptions>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_default_fragment_scan_options", 0);

  /* "pyarrow/_dataset.pyx":2268
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'csv':             # <<<<<<<<<<<<<<
 *             self.csv_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_csv, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2269
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'csv':
 *             self.csv_format.default_fragment_scan_options = options.wrapped             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options.read_options = options.read_options
 *             self._read_options_py = options.read_options
*/
    __pyx_t_3 = __pyx_v_options->wrapped;
    __pyx_v_self->csv_format->default_fragment_scan_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "pyarrow/_dataset.pyx":2270
 *         if options.type_name == 'csv':
 *             self.csv_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options             # <<<<<<<<<<<<<<
 *             self._read_options_py = options.read_options
 *         else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_read_options, __pyx_t_1) < (0)) __PYX_ERR(0, 2270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2271
 *             self.csv_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
 *             self._read_options_py = options.read_options             # <<<<<<<<<<<<<<
 *         else:
 *             super()._set_default_fragment_scan_options(options)
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2271, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ReadOptions))))) __PYX_ERR(0, 2271, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
    __pyx_v_self->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2268
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'csv':             # <<<<<<<<<<<<<<
 *             self.csv_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2273
 *             self._read_options_py = options.read_options
 *         else:
 *             super()._set_default_fragment_scan_options(options)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, CsvFileFormat other):
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_1 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_v_options)};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_default_fragment_scan_optio, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":2267
 *         self.csv_format.parse_options = deref(parse_options.options)
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         if options.type_name == 'csv':
 *             self.csv_format.default_fragment_scan_options = options.wrapped
*/

  /* 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat._set_default_fragment_scan_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2275
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, CsvFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_5equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_4equals, "CsvFileFormat.equals(self, CsvFileFormat other)\n\nParameters\n----------\nother : pyarrow.dataset.CsvFileFormat\n\nReturns\n-------\nbool");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_5equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_5equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_4equals};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_5equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_other = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2275, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2275, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equals", 0) < (0)) __PYX_ERR(0, 2275, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 2275, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2275, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2275, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, 1, "other", 0))) __PYX_ERR(0, 2275, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_4equals(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_4equals(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__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;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/_dataset.pyx":2285
 *         bool
 *         """
 *         return (             # <<<<<<<<<<<<<<
 *             self.parse_options.equals(other.parse_options) and
 *             self.default_fragment_scan_options ==
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2286
 *         """
 *         return (
 *             self.parse_options.equals(other.parse_options) and             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options ==
 *             other.default_fragment_scan_options)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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 (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2286, __pyx_L1_error)
  if (__pyx_t_7) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2287
 *         return (
 *             self.parse_options.equals(other.parse_options) and
 *             self.default_fragment_scan_options ==             # <<<<<<<<<<<<<<
 *             other.default_fragment_scan_options)
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":2288
 *             self.parse_options.equals(other.parse_options) and
 *             self.default_fragment_scan_options ==
 *             other.default_fragment_scan_options)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2275
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, CsvFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

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

/* "pyarrow/_dataset.pyx":2290
 *             other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFileFormat, (self.parse_options,
 *                                self.default_fragment_scan_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__, "CsvFileFormat.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2291
 * 
 *     def __reduce__(self):
 *         return CsvFileFormat, (self.parse_options,             # <<<<<<<<<<<<<<
 *                                self.default_fragment_scan_options)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":2292
 *     def __reduce__(self):
 *         return CsvFileFormat, (self.parse_options,
 *                                self.default_fragment_scan_options)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":2291
 * 
 *     def __reduce__(self):
 *         return CsvFileFormat, (self.parse_options,             # <<<<<<<<<<<<<<
 *                                self.default_fragment_scan_options)
 * 
*/
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2291, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 2291, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat)) != (0)) __PYX_ERR(0, 2291, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2291, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2290
 *             other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFileFormat, (self.parse_options,
 *                                self.default_fragment_scan_options)
*/

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

/* "pyarrow/_dataset.pyx":2294
 *                                self.default_fragment_scan_options)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<CsvFileFormat parse_options={self.parse_options}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_9__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_8__repr__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_8__repr__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_dataset.pyx":2295
 * 
 *     def __repr__(self):
 *         return f"<CsvFileFormat parse_options={self.parse_options}>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_CsvFileFormat_parse_options;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__43;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2295, __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/_dataset.pyx":2294
 *                                self.default_fragment_scan_options)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<CsvFileFormat parse_options={self.parse_options}>"
 * 
*/

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

/* "pyarrow/_dataset.pyx":2209
 *         # We need to store it here and override it when reading
 *         # default_fragment_scan_options.read_options
 *         public ReadOptions _read_options_py             # <<<<<<<<<<<<<<
 * 
 *     # Avoid mistakingly creating attributes
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py___get__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ReadOptions))))) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
  __pyx_v_self->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileFormat._read_options_py.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_4__del__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_4__del__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
  __pyx_v_self->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None);

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

/* "pyarrow/_dataset.pyx":2319
 *     __slots__ = ()
 * 
 *     def __init__(self, ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options = 0;
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_convert_options,&__pyx_mstate_global->__pyx_n_u_read_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2319, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2319, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2320
 * 
 *     def __init__(self, ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CCsvFragmentScanOptions()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2319
 *     __slots__ = ()
 * 
 *     def __init__(self, ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2320
 * 
 *     def __init__(self, ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CCsvFragmentScanOptions()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None));
    }
    __pyx_v_convert_options = ((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)values[0]);
    __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_convert_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ConvertOptions, 1, "convert_options", 0))) __PYX_ERR(0, 2319, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ReadOptions, 1, "read_options", 0))) __PYX_ERR(0, 2320, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self), __pyx_v_convert_options, __pyx_v_read_options);

  /* "pyarrow/_dataset.pyx":2319
 *     __slots__ = ()
 * 
 *     def __init__(self, ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  arrow::dataset::CsvFragmentScanOptions *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2322
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CCsvFragmentScanOptions()))             # <<<<<<<<<<<<<<
 *         if convert_options is not None:
 *             self.convert_options = convert_options
*/
  try {
    __pyx_t_1 = new arrow::dataset::CsvFragmentScanOptions();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2322, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":2321
 *     def __init__(self, ConvertOptions convert_options=None,
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](             # <<<<<<<<<<<<<<
 *             new CCsvFragmentScanOptions()))
 *         if convert_options is not None:
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), std::shared_ptr<arrow::dataset::FragmentScanOptions> (__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2323
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CCsvFragmentScanOptions()))
 *         if convert_options is not None:             # <<<<<<<<<<<<<<
 *             self.convert_options = convert_options
 *         if read_options is not None:
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_convert_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2324
 *             new CCsvFragmentScanOptions()))
 *         if convert_options is not None:
 *             self.convert_options = convert_options             # <<<<<<<<<<<<<<
 *         if read_options is not None:
 *             self.read_options = read_options
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_convert_options, ((PyObject *)__pyx_v_convert_options)) < (0)) __PYX_ERR(0, 2324, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2323
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CCsvFragmentScanOptions()))
 *         if convert_options is not None:             # <<<<<<<<<<<<<<
 *             self.convert_options = convert_options
 *         if read_options is not None:
*/
  }

  /* "pyarrow/_dataset.pyx":2325
 *         if convert_options is not None:
 *             self.convert_options = convert_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self.read_options = read_options
 *             self._read_options_py = read_options
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_read_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2326
 *             self.convert_options = convert_options
 *         if read_options is not None:
 *             self.read_options = read_options             # <<<<<<<<<<<<<<
 *             self._read_options_py = read_options
 * 
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options, ((PyObject *)__pyx_v_read_options)) < (0)) __PYX_ERR(0, 2326, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2327
 *         if read_options is not None:
 *             self.read_options = read_options
 *             self._read_options_py = read_options             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
*/
    __Pyx_INCREF((PyObject *)__pyx_v_read_options);
    __Pyx_GIVEREF((PyObject *)__pyx_v_read_options);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
    __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
    __pyx_v_self->_read_options_py = __pyx_v_read_options;

    /* "pyarrow/_dataset.pyx":2325
 *         if convert_options is not None:
 *             self.convert_options = convert_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self.read_options = read_options
 *             self._read_options_py = read_options
*/
  }

  /* "pyarrow/_dataset.pyx":2319
 *     __slots__ = ()
 * 
 *     def __init__(self, ConvertOptions convert_options=None,             # <<<<<<<<<<<<<<
 *                  ReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2329
 *             self._read_options_py = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         FragmentScanOptions.init(self, sp)
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_22CsvFragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2330
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
 *         FragmentScanOptions.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_init(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2331
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
 *         FragmentScanOptions.init(self, sp)
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->csv_options = ((arrow::dataset::CsvFragmentScanOptions *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2329
 *             self._read_options_py = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         FragmentScanOptions.init(self, sp)
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":2333
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def convert_options(self):
 *         return ConvertOptions.wrap(self.csv_options.convert_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2335
 *     @property
 *     def convert_options(self):
 *         return ConvertOptions.wrap(self.csv_options.convert_options)             # <<<<<<<<<<<<<<
 * 
 *     @convert_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_4_csv_ConvertOptions->wrap(__pyx_v_self->csv_options->convert_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2333
 *         self.csv_options = <CCsvFragmentScanOptions*> sp.get()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def convert_options(self):
 *         return ConvertOptions.wrap(self.csv_options.convert_options)
*/

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

/* "pyarrow/_dataset.pyx":2337
 *         return ConvertOptions.wrap(self.csv_options.convert_options)
 * 
 *     @convert_options.setter             # <<<<<<<<<<<<<<
 *     def convert_options(self, ConvertOptions convert_options not None):
 *         self.csv_options.convert_options = deref(convert_options.options)
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_convert_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_convert_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_convert_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ConvertOptions, 0, "convert_options", 0))) __PYX_ERR(0, 2338, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *)__pyx_v_convert_options));

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

static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ConvertOptions *__pyx_v_convert_options) {
  int __pyx_r;

  /* "pyarrow/_dataset.pyx":2339
 *     @convert_options.setter
 *     def convert_options(self, ConvertOptions convert_options not None):
 *         self.csv_options.convert_options = deref(convert_options.options)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->csv_options->convert_options = (*__pyx_v_convert_options->options);

  /* "pyarrow/_dataset.pyx":2337
 *         return ConvertOptions.wrap(self.csv_options.convert_options)
 * 
 *     @convert_options.setter             # <<<<<<<<<<<<<<
 *     def convert_options(self, ConvertOptions convert_options not None):
 *         self.csv_options.convert_options = deref(convert_options.options)
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2341
 *         self.csv_options.convert_options = deref(convert_options.options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2343
 *     @property
 *     def read_options(self):
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)             # <<<<<<<<<<<<<<
 *         if self._read_options_py is not None:
 *             read_options.encoding = self._read_options_py.encoding
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_4_csv_ReadOptions->wrap(__pyx_v_self->csv_options->read_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2344
 *     def read_options(self):
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)
 *         if self._read_options_py is not None:             # <<<<<<<<<<<<<<
 *             read_options.encoding = self._read_options_py.encoding
 *         return read_options
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_self->_read_options_py) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2345
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)
 *         if self._read_options_py is not None:
 *             read_options.encoding = self._read_options_py.encoding             # <<<<<<<<<<<<<<
 *         return read_options
 * 
*/
    __pyx_t_1 = __pyx_v_self->_read_options_py->encoding;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_read_options->encoding);
    __Pyx_DECREF(__pyx_v_read_options->encoding);
    __pyx_v_read_options->encoding = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":2344
 *     def read_options(self):
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)
 *         if self._read_options_py is not None:             # <<<<<<<<<<<<<<
 *             read_options.encoding = self._read_options_py.encoding
 *         return read_options
*/
  }

  /* "pyarrow/_dataset.pyx":2346
 *         if self._read_options_py is not None:
 *             read_options.encoding = self._read_options_py.encoding
 *         return read_options             # <<<<<<<<<<<<<<
 * 
 *     @read_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_read_options);
  __pyx_r = ((PyObject *)__pyx_v_read_options);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2341
 *         self.csv_options.convert_options = deref(convert_options.options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         read_options = ReadOptions.wrap(self.csv_options.read_options)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.read_options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_read_options);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2348
 *         return read_options
 * 
 *     @read_options.setter             # <<<<<<<<<<<<<<
 *     def read_options(self, ReadOptions read_options not None):
 *         self.csv_options.read_options = deref(read_options.options)
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_read_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_read_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_ReadOptions, 0, "read_options", 0))) __PYX_ERR(0, 2349, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)__pyx_v_read_options));

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

static int __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_ReadOptions *__pyx_v_read_options) {
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  std::shared_ptr<std::function<__pyx_t_7pyarrow_8includes_8libarrow_StreamWrapFunc> >  __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/_dataset.pyx":2350
 *     @read_options.setter
 *     def read_options(self, ReadOptions read_options not None):
 *         self.csv_options.read_options = deref(read_options.options)             # <<<<<<<<<<<<<<
 *         self._read_options_py = read_options
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':
*/
  __pyx_v_self->csv_options->read_options = (*__pyx_v_read_options->options);

  /* "pyarrow/_dataset.pyx":2351
 *     def read_options(self, ReadOptions read_options not None):
 *         self.csv_options.read_options = deref(read_options.options)
 *         self._read_options_py = read_options             # <<<<<<<<<<<<<<
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':
 *             self.csv_options.stream_transform_func = deref(
*/
  __Pyx_INCREF((PyObject *)__pyx_v_read_options);
  __Pyx_GIVEREF((PyObject *)__pyx_v_read_options);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_read_options_py);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_read_options_py);
  __pyx_v_self->_read_options_py = __pyx_v_read_options;

  /* "pyarrow/_dataset.pyx":2352
 *         self.csv_options.read_options = deref(read_options.options)
 *         self._read_options_py = read_options
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':             # <<<<<<<<<<<<<<
 *             self.csv_options.stream_transform_func = deref(
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_codecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_read_options->encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_utf_8, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "pyarrow/_dataset.pyx":2354
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':
 *             self.csv_options.stream_transform_func = deref(
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, CsvFragmentScanOptions other):
*/
    __pyx_t_4 = __pyx_v_read_options->encoding;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = __pyx_f_7pyarrow_3lib_make_streamwrap_func(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_utf_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2354, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2353
 *         self._read_options_py = read_options
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':
 *             self.csv_options.stream_transform_func = deref(             # <<<<<<<<<<<<<<
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
 * 
*/
    __pyx_v_self->csv_options->stream_transform_func = (*__pyx_t_7);

    /* "pyarrow/_dataset.pyx":2352
 *         self.csv_options.read_options = deref(read_options.options)
 *         self._read_options_py = read_options
 *         if codecs.lookup(read_options.encoding).name != 'utf-8':             # <<<<<<<<<<<<<<
 *             self.csv_options.stream_transform_func = deref(
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
*/
  }

  /* "pyarrow/_dataset.pyx":2348
 *         return read_options
 * 
 *     @read_options.setter             # <<<<<<<<<<<<<<
 *     def read_options(self, ReadOptions read_options not None):
 *         self.csv_options.read_options = deref(read_options.options)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.read_options.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2356
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
 * 
 *     def equals(self, CsvFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals, "CsvFragmentScanOptions.equals(self, CsvFragmentScanOptions other)\n\nParameters\n----------\nother : pyarrow.dataset.CsvFragmentScanOptions\n\nReturns\n-------\nbool");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals};
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_other = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equals", 0) < (0)) __PYX_ERR(0, 2356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 2356, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2356, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.CsvFragmentScanOptions.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, 1, "other", 0))) __PYX_ERR(0, 2356, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__pyx_v_other) {
  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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/_dataset.pyx":2366
 *         bool
 *         """
 *         return (             # <<<<<<<<<<<<<<
 *             other and
 *             self.convert_options.equals(other.convert_options) and
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2367
 *         """
 *         return (
 *             other and             # <<<<<<<<<<<<<<
 *             self.convert_options.equals(other.convert_options) and
 *             self.read_options.equals(other.read_options))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_other)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2367, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_other);
    __pyx_t_1 = ((PyObject *)__pyx_v_other);
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2368
 *         return (
 *             other and
 *             self.convert_options.equals(other.convert_options) and             # <<<<<<<<<<<<<<
 *             self.read_options.equals(other.read_options))
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_convert_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_convert_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2368, __pyx_L1_error)
  if (__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2369
 *             other and
 *             self.convert_options.equals(other.convert_options) and
 *             self.read_options.equals(other.read_options))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2356
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
 * 
 *     def equals(self, CsvFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

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

/* "pyarrow/_dataset.pyx":2371
 *             self.read_options.equals(other.read_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFragmentScanOptions, (self.convert_options,
 *                                         self.read_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__, "CsvFragmentScanOptions.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *__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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2372
 * 
 *     def __reduce__(self):
 *         return CsvFragmentScanOptions, (self.convert_options,             # <<<<<<<<<<<<<<
 *                                         self.read_options)
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_convert_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":2373
 *     def __reduce__(self):
 *         return CsvFragmentScanOptions, (self.convert_options,
 *                                         self.read_options)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":2372
 * 
 *     def __reduce__(self):
 *         return CsvFragmentScanOptions, (self.convert_options,             # <<<<<<<<<<<<<<
 *                                         self.read_options)
 * 
*/
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2372, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 2372, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions)) != (0)) __PYX_ERR(0, 2372, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2372, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2371
 *             self.read_options.equals(other.read_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFragmentScanOptions, (self.convert_options,
 *                                         self.read_options)
*/

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

/* "pyarrow/_dataset.pyx":2381
 *         object _properties
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2382
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2381
 *         object _properties
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2384
 *         _forbid_instantiation(self.__class__)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         return WriteOptions.wrap(deref(self.csv_options.write_options))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options___get__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2386
 *     @property
 *     def write_options(self):
 *         return WriteOptions.wrap(deref(self.csv_options.write_options))             # <<<<<<<<<<<<<<
 * 
 *     @write_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_4_csv_WriteOptions->wrap((*__pyx_v_self->csv_options->write_options))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2384
 *         _forbid_instantiation(self.__class__)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         return WriteOptions.wrap(deref(self.csv_options.write_options))
*/

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

/* "pyarrow/_dataset.pyx":2388
 *         return WriteOptions.wrap(deref(self.csv_options.write_options))
 * 
 *     @write_options.setter             # <<<<<<<<<<<<<<
 *     def write_options(self, WriteOptions write_options not None):
 *         self.csv_options.write_options.reset(
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_write_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_write_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_write_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_4_csv_WriteOptions, 0, "write_options", 0))) __PYX_ERR(0, 2389, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_4_csv_WriteOptions *)__pyx_v_write_options));

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

static int __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_4_csv_WriteOptions *__pyx_v_write_options) {
  int __pyx_r;

  /* "pyarrow/_dataset.pyx":2390
 *     @write_options.setter
 *     def write_options(self, WriteOptions write_options not None):
 *         self.csv_options.write_options.reset(             # <<<<<<<<<<<<<<
 *             new CCSVWriteOptions(deref(write_options.options)))
 * 
*/
  __pyx_v_self->csv_options->write_options.reset(new  arrow::csv::WriteOptions((*__pyx_v_write_options->options)));

  /* "pyarrow/_dataset.pyx":2388
 *         return WriteOptions.wrap(deref(self.csv_options.write_options))
 * 
 *     @write_options.setter             # <<<<<<<<<<<<<<
 *     def write_options(self, WriteOptions write_options not None):
 *         self.csv_options.write_options.reset(
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2393
 *             new CCSVWriteOptions(deref(write_options.options)))
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         FileWriteOptions.init(self, sp)
 *         self.csv_options = <CCsvFileWriteOptions*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_19CsvFileWriteOptions_init(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2394
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         FileWriteOptions.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.csv_options = <CCsvFileWriteOptions*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_init(((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2395
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):
 *         FileWriteOptions.init(self, sp)
 *         self.csv_options = <CCsvFileWriteOptions*> sp.get()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->csv_options = ((arrow::dataset::CsvFileWriteOptions *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2393
 *             new CCSVWriteOptions(deref(write_options.options)))
 * 
 *     cdef void init(self, const shared_ptr[CFileWriteOptions]& sp):             # <<<<<<<<<<<<<<
 *         FileWriteOptions.init(self, sp)
 *         self.csv_options = <CCsvFileWriteOptions*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileWriteOptions.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__, "CsvFileWriteOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_csv_options, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileWriteOptions.__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.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__, "CsvFileWriteOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.CsvFileWriteOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_csv_options, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":2417
 *     __slots__ = ()
 * 
 *     def __init__(self, default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_default_fragment_scan_options = 0;
  struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options = 0;
  struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_default_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_parse_options,&__pyx_mstate_global->__pyx_n_u_read_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2417, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2417, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":2418
 * 
 *     def __init__(self, default_fragment_scan_options=None,
 *                  JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2419
 *     def __init__(self, default_fragment_scan_options=None,
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2417
 *     __slots__ = ()
 * 
 *     def __init__(self, default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":2418
 * 
 *     def __init__(self, default_fragment_scan_options=None,
 *                  JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2419
 *     def __init__(self, default_fragment_scan_options=None,
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)Py_None));
    }
    __pyx_v_default_fragment_scan_options = values[0];
    __pyx_v_parse_options = ((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)values[1]);
    __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 2417, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.JsonFileFormat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parse_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ParseOptions, 1, "parse_options", 0))) __PYX_ERR(0, 2418, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ReadOptions, 1, "read_options", 0))) __PYX_ERR(0, 2419, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat___init__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)__pyx_v_self), __pyx_v_default_fragment_scan_options, __pyx_v_parse_options, __pyx_v_read_options);

  /* "pyarrow/_dataset.pyx":2417
 *     __slots__ = ()
 * 
 *     def __init__(self, default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat___init__(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, PyObject *__pyx_v_default_fragment_scan_options, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  arrow::dataset::JsonFileFormat *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2420
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))             # <<<<<<<<<<<<<<
 *         if parse_options is not None or read_options is not None:
 *             if default_fragment_scan_options is not None:
*/
  try {
    __pyx_t_1 = new arrow::dataset::JsonFileFormat();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2420, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFileFormat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), std::shared_ptr<arrow::dataset::FileFormat> (__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2421
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:             # <<<<<<<<<<<<<<
 *             if default_fragment_scan_options is not None:
 *                 raise ValueError('If `default_fragment_scan_options` is '
*/
  __pyx_t_3 = (((PyObject *)__pyx_v_parse_options) != Py_None);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (((PyObject *)__pyx_v_read_options) != Py_None);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2422
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:
 *             if default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify read_options')
*/
    __pyx_t_2 = (__pyx_v_default_fragment_scan_options != Py_None);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/_dataset.pyx":2423
 *         if parse_options is not None or read_options is not None:
 *             if default_fragment_scan_options is not None:
 *                 raise ValueError('If `default_fragment_scan_options` is '             # <<<<<<<<<<<<<<
 *                                  'given, cannot specify read_options')
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_If_default_fragment_scan_options_2};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2423, __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(0, 2423, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":2422
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:
 *             if default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify read_options')
*/
    }

    /* "pyarrow/_dataset.pyx":2425
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify read_options')
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 parse_options=parse_options,
 *                 read_options=read_options)
*/
    __pyx_t_5 = NULL;

    /* "pyarrow/_dataset.pyx":2427
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 parse_options=parse_options,
 *                 read_options=read_options)             # <<<<<<<<<<<<<<
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
*/
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, NULL};
      __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2425, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_parse_options, ((PyObject *)__pyx_v_parse_options), __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 2425, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_read_options, ((PyObject *)__pyx_v_read_options), __pyx_t_7, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 2425, __pyx_L1_error)
      __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __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_4)) __PYX_ERR(0, 2425, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }

    /* "pyarrow/_dataset.pyx":2425
 *                 raise ValueError('If `default_fragment_scan_options` is '
 *                                  'given, cannot specify read_options')
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 parse_options=parse_options,
 *                 read_options=read_options)
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, ((PyObject *)__pyx_t_4)) < (0)) __PYX_ERR(0, 2425, __pyx_L1_error)
    __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2421
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFileFormat](new CJsonFileFormat()))
 *         if parse_options is not None or read_options is not None:             # <<<<<<<<<<<<<<
 *             if default_fragment_scan_options is not None:
 *                 raise ValueError('If `default_fragment_scan_options` is '
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2428
 *                 parse_options=parse_options,
 *                 read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 **default_fragment_scan_options)
*/
  __pyx_t_2 = PyDict_Check(__pyx_v_default_fragment_scan_options); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2430
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 **default_fragment_scan_options)             # <<<<<<<<<<<<<<
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
*/
    if (unlikely(__pyx_v_default_fragment_scan_options == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 2430, __pyx_L1_error)
    }
    if (likely(PyDict_CheckExact(__pyx_v_default_fragment_scan_options))) {
      __pyx_t_4 = PyDict_Copy(__pyx_v_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }

    /* "pyarrow/_dataset.pyx":2429
 *                 read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(             # <<<<<<<<<<<<<<
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):
*/
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions), __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, __pyx_t_7) < (0)) __PYX_ERR(0, 2429, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/_dataset.pyx":2428
 *                 parse_options=parse_options,
 *                 read_options=read_options)
 *         elif isinstance(default_fragment_scan_options, dict):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 **default_fragment_scan_options)
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2431
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_default_fragment_scan_options, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2432
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options             # <<<<<<<<<<<<<<
 *         elif default_fragment_scan_options is not None:
 *             raise TypeError('`default_fragment_scan_options` must be either '
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options, __pyx_v_default_fragment_scan_options) < (0)) __PYX_ERR(0, 2432, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2431
 *             self.default_fragment_scan_options = JsonFragmentScanOptions(
 *                 **default_fragment_scan_options)
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2433
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError('`default_fragment_scan_options` must be either '
 *                             'a dictionary or an instance of '
*/
  __pyx_t_2 = (__pyx_v_default_fragment_scan_options != Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":2434
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:
 *             raise TypeError('`default_fragment_scan_options` must be either '             # <<<<<<<<<<<<<<
 *                             'a dictionary or an instance of '
 *                             'JsonFragmentScanOptions')
*/
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_default_fragment_scan_options_m_2};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 2434, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2433
 *         elif isinstance(default_fragment_scan_options, JsonFragmentScanOptions):
 *             self.default_fragment_scan_options = default_fragment_scan_options
 *         elif default_fragment_scan_options is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError('`default_fragment_scan_options` must be either '
 *                             'a dictionary or an instance of '
*/
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":2417
 *     __slots__ = ()
 * 
 *     def __init__(self, default_fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                  JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.JsonFileFormat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2438
 *                             'JsonFragmentScanOptions')
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         FileFormat.init(self, sp)
 *         self.json_format = <CJsonFileFormat*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_14JsonFileFormat_init(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, std::shared_ptr<arrow::dataset::FileFormat>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2439
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         FileFormat.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.json_format = <CJsonFileFormat*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_10FileFormat_init(((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2440
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):
 *         FileFormat.init(self, sp)
 *         self.json_format = <CJsonFileFormat*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
*/
  __pyx_v_self->json_format = ((arrow::dataset::JsonFileFormat *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2438
 *                             'JsonFragmentScanOptions')
 * 
 *     cdef void init(self, const shared_ptr[CFileFormat]& sp):             # <<<<<<<<<<<<<<
 *         FileFormat.init(self, sp)
 *         self.json_format = <CJsonFileFormat*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.JsonFileFormat.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":2442
 *         self.json_format = <CJsonFileFormat*> sp.get()
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         if options.type_name == 'json':
 *             self.json_format.default_fragment_scan_options = options.wrapped
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_14JsonFileFormat__set_default_fragment_scan_options(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_options) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  std::shared_ptr<arrow::dataset::FragmentScanOptions>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_default_fragment_scan_options", 0);

  /* "pyarrow/_dataset.pyx":2443
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'json':             # <<<<<<<<<<<<<<
 *             self.json_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_json, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2444
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'json':
 *             self.json_format.default_fragment_scan_options = options.wrapped             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options.read_options = options.read_options
 *             self.default_fragment_scan_options.parse_options = options.parse_options
*/
    __pyx_t_3 = __pyx_v_options->wrapped;
    __pyx_v_self->json_format->default_fragment_scan_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "pyarrow/_dataset.pyx":2445
 *         if options.type_name == 'json':
 *             self.json_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options             # <<<<<<<<<<<<<<
 *             self.default_fragment_scan_options.parse_options = options.parse_options
 *         else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_read_options, __pyx_t_1) < (0)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":2446
 *             self.json_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
 *             self.default_fragment_scan_options.parse_options = options.parse_options             # <<<<<<<<<<<<<<
 *         else:
 *             super()._set_default_fragment_scan_options(options)
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_parse_options, __pyx_t_4) < (0)) __PYX_ERR(0, 2446, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":2443
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):
 *         if options.type_name == 'json':             # <<<<<<<<<<<<<<
 *             self.json_format.default_fragment_scan_options = options.wrapped
 *             self.default_fragment_scan_options.read_options = options.read_options
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2448
 *             self.default_fragment_scan_options.parse_options = options.parse_options
 *         else:
 *             super()._set_default_fragment_scan_options(options)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, JsonFileFormat other):
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_4 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_options)};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_default_fragment_scan_optio, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":2442
 *         self.json_format = <CJsonFileFormat*> sp.get()
 * 
 *     cdef _set_default_fragment_scan_options(self, FragmentScanOptions options):             # <<<<<<<<<<<<<<
 *         if options.type_name == 'json':
 *             self.json_format.default_fragment_scan_options = options.wrapped
*/

  /* 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.JsonFileFormat._set_default_fragment_scan_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2450
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, JsonFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_2equals, "JsonFileFormat.equals(self, JsonFileFormat other)\n\nParameters\n----------\nother : pyarrow.dataset.JsonFileFormat\n\nReturns\n-------\nbool");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14JsonFileFormat_3equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_2equals};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_other = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2450, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2450, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equals", 0) < (0)) __PYX_ERR(0, 2450, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 2450, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2450, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2450, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.JsonFileFormat.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat, 1, "other", 0))) __PYX_ERR(0, 2450, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_2equals(((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_2equals(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_other) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/_dataset.pyx":2460
 *         bool
 *         """
 *         return (other and             # <<<<<<<<<<<<<<
 *                 self.default_fragment_scan_options ==
 *                 other.default_fragment_scan_options)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_other)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2460, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_other);
    __pyx_t_1 = ((PyObject *)__pyx_v_other);
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2461
 *         """
 *         return (other and
 *                 self.default_fragment_scan_options ==             # <<<<<<<<<<<<<<
 *                 other.default_fragment_scan_options)
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":2462
 *         return (other and
 *                 self.default_fragment_scan_options ==
 *                 other.default_fragment_scan_options)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_t_5;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2450
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, JsonFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

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

/* "pyarrow/_dataset.pyx":2464
 *                 other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFileFormat, (self.default_fragment_scan_options,)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__, "JsonFileFormat.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2465
 * 
 *     def __reduce__(self):
 *         return JsonFileFormat, (self.default_fragment_scan_options,)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_default_fragment_scan_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2465, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat)) != (0)) __PYX_ERR(0, 2465, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 2465, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2464
 *                 other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFileFormat, (self.default_fragment_scan_options,)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2467
 *         return JsonFileFormat, (self.default_fragment_scan_options,)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<JsonFileFormat>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_7__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_6__repr__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_14JsonFileFormat_6__repr__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_dataset.pyx":2468
 * 
 *     def __repr__(self):
 *         return "<JsonFileFormat>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_JsonFileFormat);
  __pyx_r = __pyx_mstate_global->__pyx_kp_u_JsonFileFormat;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2467
 *         return JsonFileFormat, (self.default_fragment_scan_options,)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<JsonFileFormat>"
 * 
*/

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

/* "pyarrow/_dataset.pyx":2488
 *     __slots__ = ()
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options = 0;
  struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_parse_options,&__pyx_mstate_global->__pyx_n_u_read_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2488, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2488, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2488, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2488, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2489
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CJsonFragmentScanOptions()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2488, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2488, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2488
 *     __slots__ = ()
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":2489
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CJsonFragmentScanOptions()))
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)Py_None));
    }
    __pyx_v_parse_options = ((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)values[0]);
    __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2488, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.JsonFragmentScanOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parse_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ParseOptions, 1, "parse_options", 0))) __PYX_ERR(0, 2488, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ReadOptions, 1, "read_options", 0))) __PYX_ERR(0, 2489, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self), __pyx_v_parse_options, __pyx_v_read_options);

  /* "pyarrow/_dataset.pyx":2488
 *     __slots__ = ()
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options) {
  int __pyx_r;
  arrow::dataset::JsonFragmentScanOptions *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2491
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CJsonFragmentScanOptions()))             # <<<<<<<<<<<<<<
 *         if parse_options is not None:
 *             self.parse_options = parse_options
*/
  try {
    __pyx_t_1 = new arrow::dataset::JsonFragmentScanOptions();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2491, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":2490
 *     def __init__(self, JsonParseOptions parse_options=None,
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](             # <<<<<<<<<<<<<<
 *             new CJsonFragmentScanOptions()))
 *         if parse_options is not None:
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), std::shared_ptr<arrow::dataset::FragmentScanOptions> (__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2490, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2492
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CJsonFragmentScanOptions()))
 *         if parse_options is not None:             # <<<<<<<<<<<<<<
 *             self.parse_options = parse_options
 *         if read_options is not None:
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_parse_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2493
 *             new CJsonFragmentScanOptions()))
 *         if parse_options is not None:
 *             self.parse_options = parse_options             # <<<<<<<<<<<<<<
 *         if read_options is not None:
 *             self.read_options = read_options
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options, ((PyObject *)__pyx_v_parse_options)) < (0)) __PYX_ERR(0, 2493, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2492
 *         self.init(shared_ptr[CFragmentScanOptions](
 *             new CJsonFragmentScanOptions()))
 *         if parse_options is not None:             # <<<<<<<<<<<<<<
 *             self.parse_options = parse_options
 *         if read_options is not None:
*/
  }

  /* "pyarrow/_dataset.pyx":2494
 *         if parse_options is not None:
 *             self.parse_options = parse_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self.read_options = read_options
 * 
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_read_options) != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2495
 *             self.parse_options = parse_options
 *         if read_options is not None:
 *             self.read_options = read_options             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options, ((PyObject *)__pyx_v_read_options)) < (0)) __PYX_ERR(0, 2495, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2494
 *         if parse_options is not None:
 *             self.parse_options = parse_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             self.read_options = read_options
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2488
 *     __slots__ = ()
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,             # <<<<<<<<<<<<<<
 *                  JsonReadOptions read_options=None):
 *         self.init(shared_ptr[CFragmentScanOptions](
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.JsonFragmentScanOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2497
 *             self.read_options = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         FragmentScanOptions.init(self, sp)
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_23JsonFragmentScanOptions_init(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &__pyx_v_sp) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":2498
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
 *         FragmentScanOptions.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()
 * 
*/
  __pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_init(((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_v_self), __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2498, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2499
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):
 *         FragmentScanOptions.init(self, sp)
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->json_options = ((arrow::dataset::JsonFragmentScanOptions *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2497
 *             self.read_options = read_options
 * 
 *     cdef void init(self, const shared_ptr[CFragmentScanOptions]& sp):             # <<<<<<<<<<<<<<
 *         FragmentScanOptions.init(self, sp)
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.JsonFragmentScanOptions.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pyarrow/_dataset.pyx":2501
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def parse_options(self):
 *         return JsonParseOptions.wrap(self.json_options.parse_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options___get__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2503
 *     @property
 *     def parse_options(self):
 *         return JsonParseOptions.wrap(self.json_options.parse_options)             # <<<<<<<<<<<<<<
 * 
 *     @parse_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_5_json_ParseOptions->wrap(__pyx_v_self->json_options->parse_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2501
 *         self.json_options = <CJsonFragmentScanOptions*> sp.get()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def parse_options(self):
 *         return JsonParseOptions.wrap(self.json_options.parse_options)
*/

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

/* "pyarrow/_dataset.pyx":2505
 *         return JsonParseOptions.wrap(self.json_options.parse_options)
 * 
 *     @parse_options.setter             # <<<<<<<<<<<<<<
 *     def parse_options(self, JsonParseOptions parse_options not None):
 *         self.json_options.parse_options = parse_options.options
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parse_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parse_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parse_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ParseOptions, 0, "parse_options", 0))) __PYX_ERR(0, 2506, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_5_json_ParseOptions *)__pyx_v_parse_options));

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

static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ParseOptions *__pyx_v_parse_options) {
  int __pyx_r;
   arrow::json::ParseOptions __pyx_t_1;

  /* "pyarrow/_dataset.pyx":2507
 *     @parse_options.setter
 *     def parse_options(self, JsonParseOptions parse_options not None):
 *         self.json_options.parse_options = parse_options.options             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_v_parse_options->options;
  __pyx_v_self->json_options->parse_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":2505
 *         return JsonParseOptions.wrap(self.json_options.parse_options)
 * 
 *     @parse_options.setter             # <<<<<<<<<<<<<<
 *     def parse_options(self, JsonParseOptions parse_options not None):
 *         self.json_options.parse_options = parse_options.options
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2509
 *         self.json_options.parse_options = parse_options.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         return JsonReadOptions.wrap(self.json_options.read_options)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options___get__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options___get__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2511
 *     @property
 *     def read_options(self):
 *         return JsonReadOptions.wrap(self.json_options.read_options)             # <<<<<<<<<<<<<<
 * 
 *     @read_options.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7pyarrow_5_json_ReadOptions->wrap(__pyx_v_self->json_options->read_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2509
 *         self.json_options.parse_options = parse_options.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         return JsonReadOptions.wrap(self.json_options.read_options)
*/

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

/* "pyarrow/_dataset.pyx":2513
 *         return JsonReadOptions.wrap(self.json_options.read_options)
 * 
 *     @read_options.setter             # <<<<<<<<<<<<<<
 *     def read_options(self, JsonReadOptions read_options not None):
 *         self.json_options.read_options = read_options.options
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_read_options); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_read_options) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_5_json_ReadOptions, 0, "read_options", 0))) __PYX_ERR(0, 2514, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_5_json_ReadOptions *)__pyx_v_read_options));

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

static int __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_2__set__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_5_json_ReadOptions *__pyx_v_read_options) {
  int __pyx_r;
   arrow::json::ReadOptions __pyx_t_1;

  /* "pyarrow/_dataset.pyx":2515
 *     @read_options.setter
 *     def read_options(self, JsonReadOptions read_options not None):
 *         self.json_options.read_options = read_options.options             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, JsonFragmentScanOptions other):
*/
  __pyx_t_1 = __pyx_v_read_options->options;
  __pyx_v_self->json_options->read_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":2513
 *         return JsonReadOptions.wrap(self.json_options.read_options)
 * 
 *     @read_options.setter             # <<<<<<<<<<<<<<
 *     def read_options(self, JsonReadOptions read_options not None):
 *         self.json_options.read_options = read_options.options
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2517
 *         self.json_options.read_options = read_options.options
 * 
 *     def equals(self, JsonFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals, "JsonFragmentScanOptions.equals(self, JsonFragmentScanOptions other)\n\nParameters\n----------\nother : pyarrow.dataset.JsonFragmentScanOptions\n\nReturns\n-------\nbool");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals};
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_other = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equals (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2517, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equals", 0) < (0)) __PYX_ERR(0, 2517, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 2517, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2517, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2517, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.JsonFragmentScanOptions.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, 1, "other", 0))) __PYX_ERR(0, 2517, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__pyx_v_other) {
  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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/_dataset.pyx":2527
 *         bool
 *         """
 *         return (             # <<<<<<<<<<<<<<
 *             other and
 *             self.read_options.equals(other.read_options) and
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2528
 *         """
 *         return (
 *             other and             # <<<<<<<<<<<<<<
 *             self.read_options.equals(other.read_options) and
 *             self.parse_options.equals(other.parse_options))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_other)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2528, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_other);
    __pyx_t_1 = ((PyObject *)__pyx_v_other);
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2529
 *         return (
 *             other and
 *             self.read_options.equals(other.read_options) and             # <<<<<<<<<<<<<<
 *             self.parse_options.equals(other.parse_options))
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2529, __pyx_L1_error)
  if (__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "pyarrow/_dataset.pyx":2530
 *             other and
 *             self.read_options.equals(other.read_options) and
 *             self.parse_options.equals(other.parse_options))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_equals, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2517
 *         self.json_options.read_options = read_options.options
 * 
 *     def equals(self, JsonFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/

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

/* "pyarrow/_dataset.pyx":2532
 *             self.parse_options.equals(other.parse_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFragmentScanOptions, (self.parse_options, self.read_options)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__, "JsonFragmentScanOptions.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *__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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2533
 * 
 *     def __reduce__(self):
 *         return JsonFragmentScanOptions, (self.parse_options, self.read_options)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_parse_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2533, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 2533, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions)) != (0)) __PYX_ERR(0, 2533, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2533, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2532
 *             self.parse_options.equals(other.parse_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFragmentScanOptions, (self.parse_options, self.read_options)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2538
 * cdef class Partitioning(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_12Partitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_12Partitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning___init__(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_12Partitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2539
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2538
 * cdef class Partitioning(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2541
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.partitioning = sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_12Partitioning_init(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":2542
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.partitioning = sp.get()
 * 
*/
  __pyx_v_self->wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":2543
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         self.wrapped = sp
 *         self.partitioning = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->partitioning = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":2541
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.partitioning = sp.get()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2545
 *         self.partitioning = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CPartitioning]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_12Partitioning_wrap(std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_v_type_name = NULL;
  PyObject *__pyx_v_classes = NULL;
  PyObject *__pyx_v_class_ = NULL;
  struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":2547
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CPartitioning]& sp):
 *         type_name = frombytes(sp.get().type_name())             # <<<<<<<<<<<<<<
 * 
 *         classes = {
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_sp.get()->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_type_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2550
 * 
 *         classes = {
 *             'directory': DirectoryPartitioning,             # <<<<<<<<<<<<<<
 *             'hive': HivePartitioning,
 *             'filename': FilenamePartitioning,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_directory, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning)) < (0)) __PYX_ERR(0, 2550, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2551
 *         classes = {
 *             'directory': DirectoryPartitioning,
 *             'hive': HivePartitioning,             # <<<<<<<<<<<<<<
 *             'filename': FilenamePartitioning,
 *         }
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_hive, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning)) < (0)) __PYX_ERR(0, 2550, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2552
 *             'directory': DirectoryPartitioning,
 *             'hive': HivePartitioning,
 *             'filename': FilenamePartitioning,             # <<<<<<<<<<<<<<
 *         }
 * 
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_filename, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning)) < (0)) __PYX_ERR(0, 2550, __pyx_L1_error)
  __pyx_v_classes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2555
 *         }
 * 
 *         class_ = classes.get(type_name, None)             # <<<<<<<<<<<<<<
 *         if class_ is None:
 *             raise TypeError(type_name)
*/
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_classes, __pyx_v_type_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_class_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2556
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  __pyx_t_6 = (__pyx_v_class_ == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_dataset.pyx":2557
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:
 *             raise TypeError(type_name)             # <<<<<<<<<<<<<<
 * 
 *         cdef Partitioning self = class_.__new__(class_)
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_type_name};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2557, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2556
 * 
 *         class_ = classes.get(type_name, None)
 *         if class_ is None:             # <<<<<<<<<<<<<<
 *             raise TypeError(type_name)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2559
 *             raise TypeError(type_name)
 * 
 *         cdef Partitioning self = class_.__new__(class_)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_3 = __pyx_v_class_;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_class_};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning))))) __PYX_ERR(0, 2559, __pyx_L1_error)
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2560
 * 
 *         cdef Partitioning self = class_.__new__(class_)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2561
 *         cdef Partitioning self = class_.__new__(class_)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CPartitioning] unwrap(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2545
 *         self.partitioning = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CPartitioning]& sp):
 *         type_name = frombytes(sp.get().type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_classes);
  __Pyx_XDECREF(__pyx_v_class_);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2563
 *         return self
 * 
 *     cdef inline shared_ptr[CPartitioning] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::Partitioning>  __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_r;

  /* "pyarrow/_dataset.pyx":2564
 * 
 *     cdef inline shared_ptr[CPartitioning] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2563
 *         return self
 * 
 *     cdef inline shared_ptr[CPartitioning] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2566
 *         return self.wrapped
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Partitioning):
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_3__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_2__eq__(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_2__eq__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/_dataset.pyx":2567
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Partitioning):             # <<<<<<<<<<<<<<
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
 *         return False
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning); 
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":2568
 *     def __eq__(self, other):
 *         if isinstance(other, Partitioning):
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))             # <<<<<<<<<<<<<<
 *         return False
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_other)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2568, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->partitioning->Equals((*__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":2567
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Partitioning):             # <<<<<<<<<<<<<<
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
 *         return False
*/
  }

  /* "pyarrow/_dataset.pyx":2569
 *         if isinstance(other, Partitioning):
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def parse(self, path):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2566
 *         return self.wrapped
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Partitioning):
 *             return self.partitioning.Equals(deref((<Partitioning>other).unwrap()))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2571
 *         return False
 * 
 *     def parse(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Parse a path into a partition expression.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_5parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12Partitioning_4parse, "Partitioning.parse(self, path)\n\nParse a path into a partition expression.\n\nParameters\n----------\npath : str\n\nReturns\n-------\npyarrow.dataset.Expression");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12Partitioning_5parse = {"parse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_5parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_4parse};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_5parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_path = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2571, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parse", 0) < (0)) __PYX_ERR(0, 2571, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse", 1, 1, 1, i); __PYX_ERR(0, 2571, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2571, __pyx_L3_error)
    }
    __pyx_v_path = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2571, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_4parse(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), __pyx_v_path);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_4parse(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_path) {
  arrow::Result<arrow::compute::Expression>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  arrow::compute::Expression __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 0);

  /* "pyarrow/_dataset.pyx":2584
 *         """
 *         cdef CResult[CExpression] result
 *         result = self.partitioning.Parse(tobytes(path))             # <<<<<<<<<<<<<<
 *         return Expression.wrap(GetResultValue(result))
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_path};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_v_self->partitioning->Parse(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":2585
 *         cdef CResult[CExpression] result
 *         result = self.partitioning.Parse(tobytes(path))
 *         return Expression.wrap(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     def format(self, expr):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = arrow::py::GetResultValue<arrow::compute::Expression>(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2585, __pyx_L1_error)
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_8_compute_Expression->wrap(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2571
 *         return False
 * 
 *     def parse(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Parse a path into a partition expression.
*/

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

/* "pyarrow/_dataset.pyx":2587
 *         return Expression.wrap(GetResultValue(result))
 * 
 *     def format(self, expr):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter expression into a tuple of (directory, filename) using
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_7format(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12Partitioning_6format, "Partitioning.format(self, expr)\n\nConvert a filter expression into a tuple of (directory, filename) using\nthe current partitioning scheme\n\nParameters\n----------\nexpr : pyarrow.dataset.Expression\n\nReturns\n-------\ntuple[str, str]\n\nExamples\n--------\n\nSpecify the Schema for paths like \"/2009/June\":\n\n>>> import pyarrow as pa\n>>> import pyarrow.dataset as ds\n>>> import pyarrow.compute as pc\n>>> part = ds.partitioning(pa.schema([(\"year\", pa.int16()),\n...                                   (\"month\", pa.string())]))\n>>> part.format(\n...     (pc.field(\"year\") == 1862) & (pc.field(\"month\") == \"Jan\")\n... )\n('1862/Jan', '')");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12Partitioning_7format = {"format", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_7format, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_6format};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_7format(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_expr = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_expr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2587, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2587, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "format", 0) < (0)) __PYX_ERR(0, 2587, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("format", 1, 1, 1, i); __PYX_ERR(0, 2587, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2587, __pyx_L3_error)
    }
    __pyx_v_expr = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("format", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2587, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_6format(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), __pyx_v_expr);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_6format(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, PyObject *__pyx_v_expr) {
  struct arrow::dataset::PartitionPathFormat __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  arrow::compute::Expression __pyx_t_1;
  struct arrow::dataset::PartitionPathFormat __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format", 0);

  /* "pyarrow/_dataset.pyx":2619
 * 
 *         result = GetResultValue(self.partitioning.Format(
 *             Expression.unwrap(expr)             # <<<<<<<<<<<<<<
 *         ))
 * 
*/
  if (!(likely(((__pyx_v_expr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_expr, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression))))) __PYX_ERR(0, 2619, __pyx_L1_error)
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_8_compute_Expression->unwrap(((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_expr)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2619, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2618
 *             CPartitionPathFormat result
 * 
 *         result = GetResultValue(self.partitioning.Format(             # <<<<<<<<<<<<<<
 *             Expression.unwrap(expr)
 *         ))
*/
  __pyx_t_2 = arrow::py::GetResultValue<struct arrow::dataset::PartitionPathFormat>(__pyx_v_self->partitioning->Format(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2618, __pyx_L1_error)
  __pyx_v_result = __pyx_t_2;

  /* "pyarrow/_dataset.pyx":2622
 *         ))
 * 
 *         return frombytes(result.directory), frombytes(result.filename)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_result.directory); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_result.filename); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 2622, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(0, 2622, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2587
 *         return Expression.wrap(GetResultValue(result))
 * 
 *     def format(self, expr):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter expression into a tuple of (directory, filename) using
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2624
 *         return frombytes(result.directory), frombytes(result.filename)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The arrow Schema attached to the partitioning."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_6schema_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_6schema___get__(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_6schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2627
 *     def schema(self):
 *         """The arrow Schema attached to the partitioning."""
 *         return pyarrow_wrap_schema(self.partitioning.schema())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->partitioning->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2624
 *         return frombytes(result.directory), frombytes(result.filename)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The arrow Schema attached to the partitioning."""
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__, "Partitioning.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_partitioning_self_wrapped_c, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.__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.partitioning,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__, "Partitioning.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Partitioning.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_partitioning_self_wrapped_c, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":2632
 * cdef class PartitioningFactory(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19PartitioningFactory___init__(((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_19PartitioningFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2633
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioningFactory]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2632
 * cdef class PartitioningFactory(_Weakrefable):
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2635
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioningFactory]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.factory = sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_init(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::PartitioningFactory>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":2636
 * 
 *     cdef init(self, const shared_ptr[CPartitioningFactory]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.factory = sp.get()
 * 
*/
  __pyx_v_self->wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":2637
 *     cdef init(self, const shared_ptr[CPartitioningFactory]& sp):
 *         self.wrapped = sp
 *         self.factory = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->factory = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":2635
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioningFactory]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.factory = sp.get()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2639
 *         self.factory = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CPartitioningFactory]& sp,
 *               object constructor, object options):
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(std::shared_ptr<arrow::dataset::PartitioningFactory>  const &__pyx_v_sp, PyObject *__pyx_v_constructor, PyObject *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":2642
 *     cdef wrap(const shared_ptr[CPartitioningFactory]& sp,
 *               object constructor, object options):
 *         cdef PartitioningFactory self = PartitioningFactory.__new__(             # <<<<<<<<<<<<<<
 *             PartitioningFactory
 *         )
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_8_dataset_PartitioningFactory(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2645
 *             PartitioningFactory
 *         )
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         self.constructor = constructor
 *         self.options = options
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2646
 *         )
 *         self.init(sp)
 *         self.constructor = constructor             # <<<<<<<<<<<<<<
 *         self.options = options
 *         return self
*/
  __Pyx_INCREF(__pyx_v_constructor);
  __Pyx_GIVEREF(__pyx_v_constructor);
  __Pyx_GOTREF(__pyx_v_self->constructor);
  __Pyx_DECREF(__pyx_v_self->constructor);
  __pyx_v_self->constructor = __pyx_v_constructor;

  /* "pyarrow/_dataset.pyx":2647
 *         self.init(sp)
 *         self.constructor = constructor
 *         self.options = options             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __Pyx_INCREF(__pyx_v_options);
  __Pyx_GIVEREF(__pyx_v_options);
  __Pyx_GOTREF(__pyx_v_self->options);
  __Pyx_DECREF(__pyx_v_self->options);
  __pyx_v_self->options = __pyx_v_options;

  /* "pyarrow/_dataset.pyx":2648
 *         self.constructor = constructor
 *         self.options = options
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CPartitioningFactory] unwrap(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2639
 *         self.factory = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CPartitioningFactory]& sp,
 *               object constructor, object options):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.PartitioningFactory.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2650
 *         return self
 * 
 *     cdef inline shared_ptr[CPartitioningFactory] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_r;

  /* "pyarrow/_dataset.pyx":2651
 * 
 *     cdef inline shared_ptr[CPartitioningFactory] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2650
 *         return self
 * 
 *     cdef inline shared_ptr[CPartitioningFactory] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2653
 *         return self.wrapped
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return self.constructor, self.options
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__, "PartitioningFactory.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2654
 * 
 *     def __reduce__(self):
 *         return self.constructor, self.options             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->constructor);
  __Pyx_GIVEREF(__pyx_v_self->constructor);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->constructor) != (0)) __PYX_ERR(0, 2654, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->options);
  __Pyx_GIVEREF(__pyx_v_self->options);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->options) != (0)) __PYX_ERR(0, 2654, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2653
 *         return self.wrapped
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return self.constructor, self.options
 * 
*/

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

/* "pyarrow/_dataset.pyx":2656
 *         return self.constructor, self.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type_name(self):
 *         return frombytes(self.factory.type_name())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_9type_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_9type_name_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_9type_name___get__(((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19PartitioningFactory_9type_name___get__(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2658
 *     @property
 *     def type_name(self):
 *         return frombytes(self.factory.type_name())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->factory->type_name()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2656
 *         return self.constructor, self.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type_name(self):
 *         return frombytes(self.factory.type_name())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.PartitioningFactory.type_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2661
 * 
 * 
 * cdef vector[shared_ptr[CArray]] _partitioning_dictionaries(             # <<<<<<<<<<<<<<
 *         Schema schema, dictionaries) except *:
 *     cdef:
*/

static std::vector<std::shared_ptr< arrow::Array> >  __pyx_f_7pyarrow_8_dataset__partitioning_dictionaries(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_dictionaries;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_dictionary = NULL;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  std::shared_ptr< arrow::Array>  __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_partitioning_dictionaries", 0);
  __Pyx_INCREF(__pyx_v_dictionaries);

  /* "pyarrow/_dataset.pyx":2666
 *         vector[shared_ptr[CArray]] c_dictionaries
 * 
 *     dictionaries = dictionaries or {}             # <<<<<<<<<<<<<<
 * 
 *     for field in schema:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dictionaries); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2666, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_dictionaries);
    __pyx_t_1 = __pyx_v_dictionaries;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_dictionaries, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2668
 *     dictionaries = dictionaries or {}
 * 
 *     for field in schema:             # <<<<<<<<<<<<<<
 *         dictionary = dictionaries.get(field.name)
 * 
*/
  if (likely(PyList_CheckExact(((PyObject *)__pyx_v_schema))) || PyTuple_CheckExact(((PyObject *)__pyx_v_schema))) {
    __pyx_t_1 = ((PyObject *)__pyx_v_schema); __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_schema)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2668, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2668, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2668, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2668, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":2669
 * 
 *     for field in schema:
 *         dictionary = dictionaries.get(field.name)             # <<<<<<<<<<<<<<
 * 
 *         if (isinstance(field.type, pa.DictionaryType) and
*/
    __pyx_t_6 = __pyx_v_dictionaries;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_dictionary, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":2671
 *         dictionary = dictionaries.get(field.name)
 * 
 *         if (isinstance(field.type, pa.DictionaryType) and             # <<<<<<<<<<<<<<
 *                 dictionary is not None):
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_mstate_global->__pyx_n_u_type_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_DictionaryType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = PyObject_IsInstance(__pyx_t_3, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2671, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_2 = __pyx_t_9;
      goto __pyx_L8_bool_binop_done;
    }

    /* "pyarrow/_dataset.pyx":2672
 * 
 *         if (isinstance(field.type, pa.DictionaryType) and
 *                 dictionary is not None):             # <<<<<<<<<<<<<<
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))
 *         else:
*/
    __pyx_t_9 = (__pyx_v_dictionary != Py_None);
    __pyx_t_2 = __pyx_t_9;
    __pyx_L8_bool_binop_done:;

    /* "pyarrow/_dataset.pyx":2671
 *         dictionary = dictionaries.get(field.name)
 * 
 *         if (isinstance(field.type, pa.DictionaryType) and             # <<<<<<<<<<<<<<
 *                 dictionary is not None):
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))
*/
    if (__pyx_t_2) {

      /* "pyarrow/_dataset.pyx":2673
 *         if (isinstance(field.type, pa.DictionaryType) and
 *                 dictionary is not None):
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))             # <<<<<<<<<<<<<<
 *         else:
 *             c_dictionaries.push_back(<shared_ptr[CArray]> nullptr)
*/
      __pyx_t_10 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(__pyx_v_dictionary); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2673, __pyx_L1_error)
      try {
        __pyx_v_c_dictionaries.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2673, __pyx_L1_error)
      }

      /* "pyarrow/_dataset.pyx":2671
 *         dictionary = dictionaries.get(field.name)
 * 
 *         if (isinstance(field.type, pa.DictionaryType) and             # <<<<<<<<<<<<<<
 *                 dictionary is not None):
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))
*/
      goto __pyx_L7;
    }

    /* "pyarrow/_dataset.pyx":2675
 *             c_dictionaries.push_back(pyarrow_unwrap_array(dictionary))
 *         else:
 *             c_dictionaries.push_back(<shared_ptr[CArray]> nullptr)             # <<<<<<<<<<<<<<
 * 
 *     return c_dictionaries
*/
    /*else*/ {
      try {
        __pyx_v_c_dictionaries.push_back(((std::shared_ptr< arrow::Array> )nullptr));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2675, __pyx_L1_error)
      }
    }
    __pyx_L7:;

    /* "pyarrow/_dataset.pyx":2668
 *     dictionaries = dictionaries or {}
 * 
 *     for field in schema:             # <<<<<<<<<<<<<<
 *         dictionary = dictionaries.get(field.name)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2677
 *             c_dictionaries.push_back(<shared_ptr[CArray]> nullptr)
 * 
 *     return c_dictionaries             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_c_dictionaries;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2661
 * 
 * 
 * cdef vector[shared_ptr[CArray]] _partitioning_dictionaries(             # <<<<<<<<<<<<<<
 *         Schema schema, dictionaries) except *:
 *     cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset._partitioning_dictionaries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_dictionary);
  __Pyx_XDECREF(__pyx_v_dictionaries);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2685
 *         CKeyValuePartitioning* keyvalue_partitioning
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning___init__(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2686
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2685
 *         CKeyValuePartitioning* keyvalue_partitioning
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2688
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         Partitioning.init(self, sp)
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":2689
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         Partitioning.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()
 *         self.wrapped = sp
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_12Partitioning_init(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2690
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         Partitioning.init(self, sp)
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.partitioning = sp.get()
*/
  __pyx_v_self->keyvalue_partitioning = ((arrow::dataset::KeyValuePartitioning *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2691
 *         Partitioning.init(self, sp)
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.partitioning = sp.get()
 * 
*/
  __pyx_v_self->__pyx_base.wrapped = __pyx_v_sp;

  /* "pyarrow/_dataset.pyx":2692
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()
 *         self.wrapped = sp
 *         self.partitioning = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_v_self->__pyx_base.partitioning = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":2688
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         Partitioning.init(self, sp)
 *         self.keyvalue_partitioning = <CKeyValuePartitioning*> sp.get()
*/

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

/* "pyarrow/_dataset.pyx":2694
 *         self.partitioning = sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__, "KeyValuePartitioning.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self) {
  PyObject *__pyx_v_dictionaries = NULL;
  PyObject *__pyx_v_segment_encoding = 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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2695
 * 
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries             # <<<<<<<<<<<<<<
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dictionaries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionaries = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2696
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries
 *         if dictionaries:             # <<<<<<<<<<<<<<
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dictionaries); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2696, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2697
 *         dictionaries = self.dictionaries
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))             # <<<<<<<<<<<<<<
 *         segment_encoding = _wrap_segment_encoding(
 *             deref(self.keyvalue_partitioning).segment_encoding()
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_names); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_dictionaries};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(0, 2697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_dictionaries, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":2696
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries
 *         if dictionaries:             # <<<<<<<<<<<<<<
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(
*/
  }

  /* "pyarrow/_dataset.pyx":2698
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(             # <<<<<<<<<<<<<<
 *             deref(self.keyvalue_partitioning).segment_encoding()
 *         )
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset__wrap_segment_encoding((*__pyx_v_self->keyvalue_partitioning).segment_encoding()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_segment_encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2701
 *             deref(self.keyvalue_partitioning).segment_encoding()
 *         )
 *         return self.__class__, (self.schema, dictionaries, segment_encoding)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 2701, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dictionaries);
  __Pyx_GIVEREF(__pyx_v_dictionaries);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_dictionaries) != (0)) __PYX_ERR(0, 2701, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segment_encoding);
  __Pyx_GIVEREF(__pyx_v_segment_encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_segment_encoding) != (0)) __PYX_ERR(0, 2701, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2701, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2701, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2694
 *         self.partitioning = sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/

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

/* "pyarrow/_dataset.pyx":2703
 *         return self.__class__, (self.schema, dictionaries, segment_encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dictionaries(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries___get__(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries___get__(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  PyObject *__pyx_v_res = NULL;
  std::shared_ptr< arrow::Array>  __pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr< arrow::Array> > ::iterator __pyx_t_2;
  std::shared_ptr< arrow::Array>  __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":2714
 *         """
 *         cdef vector[shared_ptr[CArray]] c_arrays
 *         c_arrays = self.keyvalue_partitioning.dictionaries()             # <<<<<<<<<<<<<<
 *         res = []
 *         for arr in c_arrays:
*/
  __pyx_v_c_arrays = __pyx_v_self->keyvalue_partitioning->dictionaries();

  /* "pyarrow/_dataset.pyx":2715
 *         cdef vector[shared_ptr[CArray]] c_arrays
 *         c_arrays = self.keyvalue_partitioning.dictionaries()
 *         res = []             # <<<<<<<<<<<<<<
 *         for arr in c_arrays:
 *             if arr.get() == nullptr:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2716
 *         c_arrays = self.keyvalue_partitioning.dictionaries()
 *         res = []
 *         for arr in c_arrays:             # <<<<<<<<<<<<<<
 *             if arr.get() == nullptr:
 *                 # Partitioning object has not been created through
*/
  __pyx_t_2 = __pyx_v_c_arrays.begin();
  for (; __pyx_t_2 != __pyx_v_c_arrays.end(); ++__pyx_t_2) {
    __pyx_t_3 = *__pyx_t_2;
    __pyx_v_arr = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "pyarrow/_dataset.pyx":2717
 *         res = []
 *         for arr in c_arrays:
 *             if arr.get() == nullptr:             # <<<<<<<<<<<<<<
 *                 # Partitioning object has not been created through
 *                 # inspected Factory
*/
    __pyx_t_4 = (__pyx_v_arr.get() == nullptr);
    if (__pyx_t_4) {

      /* "pyarrow/_dataset.pyx":2720
 *                 # Partitioning object has not been created through
 *                 # inspected Factory
 *                 res.append(None)             # <<<<<<<<<<<<<<
 *             else:
 *                 res.append(pyarrow_wrap_array(arr))
*/
      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_res, Py_None); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2720, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":2717
 *         res = []
 *         for arr in c_arrays:
 *             if arr.get() == nullptr:             # <<<<<<<<<<<<<<
 *                 # Partitioning object has not been created through
 *                 # inspected Factory
*/
      goto __pyx_L5;
    }

    /* "pyarrow/_dataset.pyx":2722
 *                 res.append(None)
 *             else:
 *                 res.append(pyarrow_wrap_array(arr))             # <<<<<<<<<<<<<<
 *         return res
 * 
*/
    /*else*/ {
      __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2722, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "pyarrow/_dataset.pyx":2716
 *         c_arrays = self.keyvalue_partitioning.dictionaries()
 *         res = []
 *         for arr in c_arrays:             # <<<<<<<<<<<<<<
 *             if arr.get() == nullptr:
 *                 # Partitioning object has not been created through
*/
  }

  /* "pyarrow/_dataset.pyx":2723
 *             else:
 *                 res.append(pyarrow_wrap_array(arr))
 *         return res             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2703
 *         return self.__class__, (self.schema, dictionaries, segment_encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dictionaries(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.KeyValuePartitioning.dictionaries.__get__", __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/_dataset.pyx":2726
 * 
 * 
 * def _constructor_directory_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return DirectoryPartitioning.discover(*args)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7_constructor_directory_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_6_constructor_directory_partitioning_factory, "_constructor_directory_partitioning_factory(*args)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7_constructor_directory_partitioning_factory = {"_constructor_directory_partitioning_factory", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_8_dataset_7_constructor_directory_partitioning_factory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_6_constructor_directory_partitioning_factory};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7_constructor_directory_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_constructor_directory_partitioning_factory (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_constructor_directory_partitioning_factory", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_6_constructor_directory_partitioning_factory(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_6_constructor_directory_partitioning_factory(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_constructor_directory_partitioning_factory", 0);

  /* "pyarrow/_dataset.pyx":2727
 * 
 * def _constructor_directory_partitioning_factory(*args):
 *     return DirectoryPartitioning.discover(*args)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning), __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __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(0, 2727, __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/_dataset.pyx":2726
 * 
 * 
 * def _constructor_directory_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return DirectoryPartitioning.discover(*args)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2768
 *         CDirectoryPartitioning* directory_partitioning
 * 
 *     def __init__(self, Schema schema not None, dictionaries=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         cdef:
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_dictionaries = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_dictionaries,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2768, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2768, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, i); __PYX_ERR(0, 2768, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2768, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_dictionaries = values[1];
    __pyx_v_segment_encoding = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 2768, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.DirectoryPartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 2768, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning___init__(((struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *)__pyx_v_self), __pyx_v_schema, __pyx_v_dictionaries, __pyx_v_segment_encoding);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_segment_encoding) {
  std::shared_ptr<arrow::dataset::DirectoryPartitioning>  __pyx_v_c_partitioning;
  arrow::dataset::KeyValuePartitioningOptions __pyx_v_c_options;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
   arrow::dataset::SegmentEncoding __pyx_t_2;
  std::shared_ptr< arrow::Schema>  __pyx_t_3;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_t_4;
  std::shared_ptr<arrow::dataset::DirectoryPartitioning>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2774
 *             CKeyValuePartitioningOptions c_options
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 *         c_partitioning = make_shared[CDirectoryPartitioning](
 *             pyarrow_unwrap_schema(schema),
*/
  __pyx_t_1 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 2774, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":2776
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 *         c_partitioning = make_shared[CDirectoryPartitioning](
 *             pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *             _partitioning_dictionaries(schema, dictionaries),
 *             c_options,
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2776, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2777
 *         c_partitioning = make_shared[CDirectoryPartitioning](
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),             # <<<<<<<<<<<<<<
 *             c_options,
 *         )
*/
  __pyx_t_4 = __pyx_f_7pyarrow_8_dataset__partitioning_dictionaries(__pyx_v_schema, __pyx_v_dictionaries); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2777, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2775
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 *         c_partitioning = make_shared[CDirectoryPartitioning](             # <<<<<<<<<<<<<<
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),
*/
  try {
    __pyx_t_5 = std::make_shared<arrow::dataset::DirectoryPartitioning>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), __pyx_v_c_options);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2775, __pyx_L1_error)
  }
  __pyx_v_c_partitioning = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":2780
 *             c_options,
 *         )
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_DirectoryPartitioning *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), ((std::shared_ptr<arrow::dataset::Partitioning> )__pyx_v_c_partitioning)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2768
 *         CDirectoryPartitioning* directory_partitioning
 * 
 *     def __init__(self, Schema schema not None, dictionaries=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.DirectoryPartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2782
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_21DirectoryPartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":2783
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2784
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->directory_partitioning = ((arrow::dataset::DirectoryPartitioning *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2782
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
*/

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

/* "pyarrow/_dataset.pyx":2786
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_3discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_21DirectoryPartitioning_2discover, "DirectoryPartitioning.discover(field_names=None, infer_dictionary=False, max_partition_dictionary_size=0, schema=None, segment_encoding='uri')\n\nDiscover a DirectoryPartitioning.\n\nParameters\n----------\nfield_names : list of str\n    The names to associate with the values from the subdirectory names.\n    If schema is given, will be populated from the schema.\ninfer_dictionary : bool, default False\n    When inferring a schema for partition fields, yield dictionary\n    encoded types instead of plain types. This can be more efficient\n    when materializing virtual columns, and Expressions parsed by the\n    finished Partitioning will include dictionaries of all unique\n    inspected values for each field.\nmax_partition_dictionary_size : int, default 0\n    Synonymous with infer_dictionary for backwards compatibility with\n    1.0: setting this to -1 or None is equivalent to passing\n    infer_dictionary=True.\nschema : Schema, default None\n    Use this schema instead of inferring a schema from partition\n    values. Partition values will be validated against this schema\n    before accumulation into the Partitioning's dictionary.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nPartitioningFactory\n    To be used in the FileSystemFactoryOptions.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_21DirectoryPartitioning_3discover = {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_3discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_21DirectoryPartitioning_2discover};
static PyObject *__pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_3discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_infer_dictionary = 0;
  PyObject *__pyx_v_max_partition_dictionary_size = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("discover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field_names,&__pyx_mstate_global->__pyx_n_u_infer_dictionary,&__pyx_mstate_global->__pyx_n_u_max_partition_dictionary_size,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2786, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "discover", 0) < (0)) __PYX_ERR(0, 2786, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":2787
 * 
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  max_partition_dictionary_size=0,
 *                  schema=None, segment_encoding="uri"):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));

      /* "pyarrow/_dataset.pyx":2789
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
 *                  schema=None, segment_encoding="uri"):             # <<<<<<<<<<<<<<
 *         """
 *         Discover a DirectoryPartitioning.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2787
 * 
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  max_partition_dictionary_size=0,
 *                  schema=None, segment_encoding="uri"):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));

      /* "pyarrow/_dataset.pyx":2789
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
 *                  schema=None, segment_encoding="uri"):             # <<<<<<<<<<<<<<
 *         """
 *         Discover a DirectoryPartitioning.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_field_names = values[0];
    __pyx_v_infer_dictionary = values[1];
    __pyx_v_max_partition_dictionary_size = values[2];
    __pyx_v_schema = values[3];
    __pyx_v_segment_encoding = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("discover", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 2786, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.DirectoryPartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning_2discover(__pyx_v_field_names, __pyx_v_infer_dictionary, __pyx_v_max_partition_dictionary_size, __pyx_v_schema, __pyx_v_segment_encoding);

  /* "pyarrow/_dataset.pyx":2786
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_21DirectoryPartitioning_2discover(PyObject *__pyx_v_field_names, PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_max_partition_dictionary_size, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding) {
  arrow::dataset::PartitioningFactoryOptions __pyx_v_c_options;
  std::vector<std::string>  __pyx_v_c_field_names;
  PyObject *__pyx_8genexpr4__pyx_v_f = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_s = 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;
  size_t __pyx_t_5;
  std::shared_ptr< arrow::Schema>  __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  std::vector<std::string>  __pyx_t_13;
   arrow::dataset::SegmentEncoding __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("discover", 0);
  __Pyx_INCREF(__pyx_v_infer_dictionary);

  /* "pyarrow/_dataset.pyx":2825
 *             vector[c_string] c_field_names
 * 
 *         if max_partition_dictionary_size in {-1, None}:             # <<<<<<<<<<<<<<
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
*/
  __Pyx_INCREF(__pyx_v_max_partition_dictionary_size);
  __pyx_t_1 = __pyx_v_max_partition_dictionary_size;
  __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2825, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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;
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2826
 * 
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True             # <<<<<<<<<<<<<<
 *         elif max_partition_dictionary_size != 0:
 *             raise NotImplementedError("max_partition_dictionary_size must be "
*/
    __Pyx_INCREF(Py_True);
    __Pyx_DECREF_SET(__pyx_v_infer_dictionary, Py_True);

    /* "pyarrow/_dataset.pyx":2825
 *             vector[c_string] c_field_names
 * 
 *         if max_partition_dictionary_size in {-1, None}:             # <<<<<<<<<<<<<<
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2827
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("max_partition_dictionary_size must be "
 *                                       "0, -1, or None")
*/
  __pyx_t_3 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_max_partition_dictionary_size, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2827, __pyx_L1_error)
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/_dataset.pyx":2828
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
 *             raise NotImplementedError("max_partition_dictionary_size must be "             # <<<<<<<<<<<<<<
 *                                       "0, -1, or None")
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_max_partition_dictionary_size_mu};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2828, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2827
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("max_partition_dictionary_size must be "
 *                                       "0, -1, or None")
*/
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":2831
 *                                       "0, -1, or None")
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_infer_dictionary); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2831, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2832
 * 
 *         if infer_dictionary:
 *             c_options.infer_dictionary = True             # <<<<<<<<<<<<<<
 * 
 *         if schema:
*/
    __pyx_v_c_options.infer_dictionary = 1;

    /* "pyarrow/_dataset.pyx":2831
 *                                       "0, -1, or None")
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2834
 *             c_options.infer_dictionary = True
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_schema); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2834, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2835
 * 
 *         if schema:
 *             c_options.schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:
*/
    __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(__pyx_v_schema); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2835, __pyx_L1_error)
    __pyx_v_c_options.schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "pyarrow/_dataset.pyx":2836
 *         if schema:
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]             # <<<<<<<<<<<<<<
 *         elif not field_names:
 *             raise ValueError(
*/
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_schema)) || PyTuple_CheckExact(__pyx_v_schema)) {
        __pyx_t_4 = __pyx_v_schema; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2836, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2836, __pyx_L10_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2836, __pyx_L10_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_7;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2836, __pyx_L10_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
            #endif
            ++__pyx_t_7;
          }
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2836, __pyx_L10_error)
        } else {
          __pyx_t_9 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2836, __pyx_L10_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_f, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2836, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr4__pyx_v_f, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2836, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
          __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2836, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2836, __pyx_L10_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_f); __pyx_8genexpr4__pyx_v_f = 0;
      goto __pyx_L14_exit_scope;
      __pyx_L10_error:;
      __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_f); __pyx_8genexpr4__pyx_v_f = 0;
      goto __pyx_L1_error;
      __pyx_L14_exit_scope:;
    } /* exit inner scope */
    __pyx_t_13 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2836, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_field_names = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13);

    /* "pyarrow/_dataset.pyx":2834
 *             c_options.infer_dictionary = True
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
*/
    goto __pyx_L7;
  }

  /* "pyarrow/_dataset.pyx":2837
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Neither field_names nor schema was passed; "
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_field_names); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2837, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_3);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":2838
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Neither field_names nor schema was passed; "
 *                 "cannot infer field_names")
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Neither_field_names_nor_schema_w};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2838, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2837
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Neither field_names nor schema was passed; "
*/
  }

  /* "pyarrow/_dataset.pyx":2842
 *                 "cannot infer field_names")
 *         else:
 *             c_field_names = [tobytes(s) for s in field_names]             # <<<<<<<<<<<<<<
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
*/
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L17_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (likely(PyList_CheckExact(__pyx_v_field_names)) || PyTuple_CheckExact(__pyx_v_field_names)) {
        __pyx_t_4 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2842, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2842, __pyx_L17_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2842, __pyx_L17_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_7;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2842, __pyx_L17_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7));
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7);
            #endif
            ++__pyx_t_7;
          }
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2842, __pyx_L17_error)
        } else {
          __pyx_t_9 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2842, __pyx_L17_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_s, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_11 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2842, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_11);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_8genexpr5__pyx_v_s};
          __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2842, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2842, __pyx_L17_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_t_13 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2842, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_field_names = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13);
  }
  __pyx_L7:;

  /* "pyarrow/_dataset.pyx":2844
 *             c_field_names = [tobytes(s) for s in field_names]
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 * 
 *         return PartitioningFactory.wrap(
*/
  __pyx_t_1 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 2844, __pyx_L1_error)
  __pyx_t_14 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

  /* "pyarrow/_dataset.pyx":2846
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CDirectoryPartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_directory_partitioning_factory,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2848
 *         return PartitioningFactory.wrap(
 *             CDirectoryPartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_directory_partitioning_factory,             # <<<<<<<<<<<<<<
 *             (field_names, infer_dictionary, max_partition_dictionary_size,
 *              schema, segment_encoding)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_constructor_directory_partition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":2849
 *             CDirectoryPartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_directory_partitioning_factory,
 *             (field_names, infer_dictionary, max_partition_dictionary_size,             # <<<<<<<<<<<<<<
 *              schema, segment_encoding)
 *         )
*/
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_field_names);
  __Pyx_GIVEREF(__pyx_v_field_names);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field_names) != (0)) __PYX_ERR(0, 2849, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_infer_dictionary);
  __Pyx_GIVEREF(__pyx_v_infer_dictionary);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_infer_dictionary) != (0)) __PYX_ERR(0, 2849, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_max_partition_dictionary_size);
  __Pyx_GIVEREF(__pyx_v_max_partition_dictionary_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_max_partition_dictionary_size) != (0)) __PYX_ERR(0, 2849, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_schema);
  __Pyx_GIVEREF(__pyx_v_schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_schema) != (0)) __PYX_ERR(0, 2849, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segment_encoding);
  __Pyx_GIVEREF(__pyx_v_segment_encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_segment_encoding) != (0)) __PYX_ERR(0, 2849, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":2846
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CDirectoryPartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_directory_partitioning_factory,
*/
  __pyx_t_9 = __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(arrow::dataset::DirectoryPartitioning::MakeFactory(__pyx_v_c_field_names, __pyx_v_c_options), __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2786
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pyarrow._dataset.DirectoryPartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_f);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_infer_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2854
 * 
 * 
 * def _constructor_hive_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return HivePartitioning.discover(*args)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_9_constructor_hive_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_8_constructor_hive_partitioning_factory, "_constructor_hive_partitioning_factory(*args)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_9_constructor_hive_partitioning_factory = {"_constructor_hive_partitioning_factory", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_8_dataset_9_constructor_hive_partitioning_factory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8_constructor_hive_partitioning_factory};
static PyObject *__pyx_pw_7pyarrow_8_dataset_9_constructor_hive_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_constructor_hive_partitioning_factory (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_constructor_hive_partitioning_factory", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_8_constructor_hive_partitioning_factory(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_8_constructor_hive_partitioning_factory(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_constructor_hive_partitioning_factory", 0);

  /* "pyarrow/_dataset.pyx":2855
 * 
 * def _constructor_hive_partitioning_factory(*args):
 *     return HivePartitioning.discover(*args)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning), __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __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(0, 2855, __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/_dataset.pyx":2854
 * 
 * 
 * def _constructor_hive_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return HivePartitioning.discover(*args)
 * 
*/

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

/* "pyarrow/_dataset.pyx":2904
 *         CHivePartitioning* hive_partitioning
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  Schema schema not None,
 *                  dictionaries=None,
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_16HivePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_16HivePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_dictionaries = 0;
  PyObject *__pyx_v_null_fallback = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_dictionaries,&__pyx_mstate_global->__pyx_n_u_null_fallback,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2904, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 2904, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":2906
 *     def __init__(self,
 *                  Schema schema not None,
 *                  dictionaries=None,             # <<<<<<<<<<<<<<
 *                  null_fallback="__HIVE_DEFAULT_PARTITION__",
 *                  segment_encoding="uri"):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_HIVE_DEFAULT_PARTITION));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, i); __PYX_ERR(0, 2904, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2904, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2904, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_HIVE_DEFAULT_PARTITION));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_dictionaries = values[1];
    __pyx_v_null_fallback = values[2];
    __pyx_v_segment_encoding = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 2904, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.HivePartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 2905, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16HivePartitioning___init__(((struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *)__pyx_v_self), __pyx_v_schema, __pyx_v_dictionaries, __pyx_v_null_fallback, __pyx_v_segment_encoding);

  /* "pyarrow/_dataset.pyx":2904
 *         CHivePartitioning* hive_partitioning
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  Schema schema not None,
 *                  dictionaries=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_16HivePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_null_fallback, PyObject *__pyx_v_segment_encoding) {
  std::shared_ptr<arrow::dataset::HivePartitioning>  __pyx_v_c_partitioning;
  arrow::dataset::HivePartitioningOptions __pyx_v_c_options;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
   arrow::dataset::SegmentEncoding __pyx_t_6;
  std::shared_ptr< arrow::Schema>  __pyx_t_7;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_t_8;
  std::shared_ptr<arrow::dataset::HivePartitioning>  __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":2914
 *             CHivePartitioningOptions c_options
 * 
 *         c_options.null_fallback = tobytes(null_fallback)             # <<<<<<<<<<<<<<
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_null_fallback};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.null_fallback = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":2915
 * 
 *         c_options.null_fallback = tobytes(null_fallback)
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 * 
 *         c_partitioning = make_shared[CHivePartitioning](
*/
  __pyx_t_1 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 2915, __pyx_L1_error)
  __pyx_t_6 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":2918
 * 
 *         c_partitioning = make_shared[CHivePartitioning](
 *             pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *             _partitioning_dictionaries(schema, dictionaries),
 *             c_options,
*/
  __pyx_t_7 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2918, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2919
 *         c_partitioning = make_shared[CHivePartitioning](
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),             # <<<<<<<<<<<<<<
 *             c_options,
 *         )
*/
  __pyx_t_8 = __pyx_f_7pyarrow_8_dataset__partitioning_dictionaries(__pyx_v_schema, __pyx_v_dictionaries); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2919, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2917
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         c_partitioning = make_shared[CHivePartitioning](             # <<<<<<<<<<<<<<
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),
*/
  try {
    __pyx_t_9 = std::make_shared<arrow::dataset::HivePartitioning>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8), __pyx_v_c_options);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2917, __pyx_L1_error)
  }
  __pyx_v_c_partitioning = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":2922
 *             c_options,
 *         )
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_HivePartitioning *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), ((std::shared_ptr<arrow::dataset::Partitioning> )__pyx_v_c_partitioning)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2904
 *         CHivePartitioning* hive_partitioning
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  Schema schema not None,
 *                  dictionaries=None,
*/

  /* 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._dataset.HivePartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2924
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_16HivePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":2925
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2926
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
*/
  __pyx_v_self->hive_partitioning = ((arrow::dataset::HivePartitioning *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":2924
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
*/

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

/* "pyarrow/_dataset.pyx":2928
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16HivePartitioning_2__reduce__, "HivePartitioning.__reduce__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16HivePartitioning_3__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16HivePartitioning_2__reduce__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_3__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16HivePartitioning_2__reduce__(((struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_16HivePartitioning_2__reduce__(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *__pyx_v_self) {
  PyObject *__pyx_v_dictionaries = NULL;
  PyObject *__pyx_v_segment_encoding = NULL;
  PyObject *__pyx_v_null_fallback = 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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/_dataset.pyx":2929
 * 
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries             # <<<<<<<<<<<<<<
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dictionaries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionaries = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2930
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries
 *         if dictionaries:             # <<<<<<<<<<<<<<
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_dictionaries); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2930, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":2931
 *         dictionaries = self.dictionaries
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))             # <<<<<<<<<<<<<<
 *         segment_encoding = _wrap_segment_encoding(
 *             deref(self.keyvalue_partitioning).segment_encoding()
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_names); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_dictionaries};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(0, 2931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_dictionaries, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":2930
 *     def __reduce__(self):
 *         dictionaries = self.dictionaries
 *         if dictionaries:             # <<<<<<<<<<<<<<
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(
*/
  }

  /* "pyarrow/_dataset.pyx":2932
 *         if dictionaries:
 *             dictionaries = dict(zip(self.schema.names, dictionaries))
 *         segment_encoding = _wrap_segment_encoding(             # <<<<<<<<<<<<<<
 *             deref(self.keyvalue_partitioning).segment_encoding()
 *         )
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset__wrap_segment_encoding((*__pyx_v_self->__pyx_base.keyvalue_partitioning).segment_encoding()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_segment_encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2935
 *             deref(self.keyvalue_partitioning).segment_encoding()
 *         )
 *         null_fallback = frombytes(deref(self.hive_partitioning).null_fallback())             # <<<<<<<<<<<<<<
 *         return HivePartitioning, (
 *             self.schema, dictionaries, null_fallback, segment_encoding
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string((*__pyx_v_self->hive_partitioning).null_fallback()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_null_fallback = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2936
 *         )
 *         null_fallback = frombytes(deref(self.hive_partitioning).null_fallback())
 *         return HivePartitioning, (             # <<<<<<<<<<<<<<
 *             self.schema, dictionaries, null_fallback, segment_encoding
 *         )
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2937
 *         null_fallback = frombytes(deref(self.hive_partitioning).null_fallback())
 *         return HivePartitioning, (
 *             self.schema, dictionaries, null_fallback, segment_encoding             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 2937, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dictionaries);
  __Pyx_GIVEREF(__pyx_v_dictionaries);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_dictionaries) != (0)) __PYX_ERR(0, 2937, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_null_fallback);
  __Pyx_GIVEREF(__pyx_v_null_fallback);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_null_fallback) != (0)) __PYX_ERR(0, 2937, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segment_encoding);
  __Pyx_GIVEREF(__pyx_v_segment_encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_segment_encoding) != (0)) __PYX_ERR(0, 2937, __pyx_L1_error);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":2936
 *         )
 *         null_fallback = frombytes(deref(self.hive_partitioning).null_fallback())
 *         return HivePartitioning, (             # <<<<<<<<<<<<<<
 *             self.schema, dictionaries, null_fallback, segment_encoding
 *         )
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning);
  __Pyx_GIVEREF((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning)) != (0)) __PYX_ERR(0, 2936, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 2936, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2928
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/

  /* 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._dataset.HivePartitioning.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dictionaries);
  __Pyx_XDECREF(__pyx_v_segment_encoding);
  __Pyx_XDECREF(__pyx_v_null_fallback);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":2940
 *         )
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_5discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16HivePartitioning_4discover, "HivePartitioning.discover(infer_dictionary=False, max_partition_dictionary_size=0, null_fallback='__HIVE_DEFAULT_PARTITION__', schema=None, segment_encoding='uri')\n\nDiscover a HivePartitioning.\n\nParameters\n----------\ninfer_dictionary : bool, default False\n    When inferring a schema for partition fields, yield dictionary\n    encoded types instead of plain. This can be more efficient when\n    materializing virtual columns, and Expressions parsed by the\n    finished Partitioning will include dictionaries of all unique\n    inspected values for each field.\nmax_partition_dictionary_size : int, default 0\n    Synonymous with infer_dictionary for backwards compatibility with\n    1.0: setting this to -1 or None is equivalent to passing\n    infer_dictionary=True.\nnull_fallback : str, default \"__HIVE_DEFAULT_PARTITION__\"\n    When inferring a schema for partition fields this value will be\n    replaced by null.  The default is set to __HIVE_DEFAULT_PARTITION__\n    for compatibility with Spark\nschema : Schema, default None\n    Use this schema instead of inferring a schema from partition\n    values. Partition values will be validated against this schema\n    before accumulation into the Partitioning's dictionary.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nPartitioningFactory\n    To be used in the FileSystemFactoryOptions.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16HivePartitioning_5discover = {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_5discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16HivePartitioning_4discover};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_5discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_infer_dictionary = 0;
  PyObject *__pyx_v_max_partition_dictionary_size = 0;
  PyObject *__pyx_v_null_fallback = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("discover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_infer_dictionary,&__pyx_mstate_global->__pyx_n_u_max_partition_dictionary_size,&__pyx_mstate_global->__pyx_n_u_null_fallback,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2940, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "discover", 0) < (0)) __PYX_ERR(0, 2940, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":2941
 * 
 *     @staticmethod
 *     def discover(infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  max_partition_dictionary_size=0,
 *                  null_fallback="__HIVE_DEFAULT_PARTITION__",
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_HIVE_DEFAULT_PARTITION));

      /* "pyarrow/_dataset.pyx":2944
 *                  max_partition_dictionary_size=0,
 *                  null_fallback="__HIVE_DEFAULT_PARTITION__",
 *                  schema=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":2941
 * 
 *     @staticmethod
 *     def discover(infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  max_partition_dictionary_size=0,
 *                  null_fallback="__HIVE_DEFAULT_PARTITION__",
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_HIVE_DEFAULT_PARTITION));

      /* "pyarrow/_dataset.pyx":2944
 *                  max_partition_dictionary_size=0,
 *                  null_fallback="__HIVE_DEFAULT_PARTITION__",
 *                  schema=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         """
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_infer_dictionary = values[0];
    __pyx_v_max_partition_dictionary_size = values[1];
    __pyx_v_null_fallback = values[2];
    __pyx_v_schema = values[3];
    __pyx_v_segment_encoding = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("discover", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 2940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.HivePartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16HivePartitioning_4discover(__pyx_v_infer_dictionary, __pyx_v_max_partition_dictionary_size, __pyx_v_null_fallback, __pyx_v_schema, __pyx_v_segment_encoding);

  /* "pyarrow/_dataset.pyx":2940
 *         )
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_16HivePartitioning_4discover(PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_max_partition_dictionary_size, PyObject *__pyx_v_null_fallback, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding) {
  arrow::dataset::HivePartitioningFactoryOptions __pyx_v_c_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  std::string __pyx_t_7;
  std::shared_ptr< arrow::Schema>  __pyx_t_8;
   arrow::dataset::SegmentEncoding __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("discover", 0);
  __Pyx_INCREF(__pyx_v_infer_dictionary);

  /* "pyarrow/_dataset.pyx":2981
 *             CHivePartitioningFactoryOptions c_options
 * 
 *         if max_partition_dictionary_size in {-1, None}:             # <<<<<<<<<<<<<<
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
*/
  __Pyx_INCREF(__pyx_v_max_partition_dictionary_size);
  __pyx_t_1 = __pyx_v_max_partition_dictionary_size;
  __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2981, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2981, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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;
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2982
 * 
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True             # <<<<<<<<<<<<<<
 *         elif max_partition_dictionary_size != 0:
 *             raise NotImplementedError("max_partition_dictionary_size must be "
*/
    __Pyx_INCREF(Py_True);
    __Pyx_DECREF_SET(__pyx_v_infer_dictionary, Py_True);

    /* "pyarrow/_dataset.pyx":2981
 *             CHivePartitioningFactoryOptions c_options
 * 
 *         if max_partition_dictionary_size in {-1, None}:             # <<<<<<<<<<<<<<
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":2983
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("max_partition_dictionary_size must be "
 *                                       "0, -1, or None")
*/
  __pyx_t_3 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_max_partition_dictionary_size, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2983, __pyx_L1_error)
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/_dataset.pyx":2984
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:
 *             raise NotImplementedError("max_partition_dictionary_size must be "             # <<<<<<<<<<<<<<
 *                                       "0, -1, or None")
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_max_partition_dictionary_size_mu};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2984, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":2983
 *         if max_partition_dictionary_size in {-1, None}:
 *             infer_dictionary = True
 *         elif max_partition_dictionary_size != 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("max_partition_dictionary_size must be "
 *                                       "0, -1, or None")
*/
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":2987
 *                                       "0, -1, or None")
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_infer_dictionary); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2987, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2988
 * 
 *         if infer_dictionary:
 *             c_options.infer_dictionary = True             # <<<<<<<<<<<<<<
 * 
 *         c_options.null_fallback = tobytes(null_fallback)
*/
    __pyx_v_c_options.infer_dictionary = 1;

    /* "pyarrow/_dataset.pyx":2987
 *                                       "0, -1, or None")
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2990
 *             c_options.infer_dictionary = True
 * 
 *         c_options.null_fallback = tobytes(null_fallback)             # <<<<<<<<<<<<<<
 * 
 *         if schema:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_null_fallback};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.null_fallback = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":2992
 *         c_options.null_fallback = tobytes(null_fallback)
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_schema); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2992, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":2993
 * 
 *         if schema:
 *             c_options.schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
*/
    __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(__pyx_v_schema); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2993, __pyx_L1_error)
    __pyx_v_c_options.schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

    /* "pyarrow/_dataset.pyx":2992
 *         c_options.null_fallback = tobytes(null_fallback)
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":2995
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 * 
 *         return PartitioningFactory.wrap(
*/
  __pyx_t_1 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 2995, __pyx_L1_error)
  __pyx_t_9 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":2997
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CHivePartitioning.MakeFactory(c_options),
 *             _constructor_hive_partitioning_factory,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":2999
 *         return PartitioningFactory.wrap(
 *             CHivePartitioning.MakeFactory(c_options),
 *             _constructor_hive_partitioning_factory,             # <<<<<<<<<<<<<<
 *             (infer_dictionary, max_partition_dictionary_size, null_fallback,
 *              schema, segment_encoding),
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_constructor_hive_partitioning_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":3000
 *             CHivePartitioning.MakeFactory(c_options),
 *             _constructor_hive_partitioning_factory,
 *             (infer_dictionary, max_partition_dictionary_size, null_fallback,             # <<<<<<<<<<<<<<
 *              schema, segment_encoding),
 *         )
*/
  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_infer_dictionary);
  __Pyx_GIVEREF(__pyx_v_infer_dictionary);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_infer_dictionary) != (0)) __PYX_ERR(0, 3000, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_max_partition_dictionary_size);
  __Pyx_GIVEREF(__pyx_v_max_partition_dictionary_size);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_max_partition_dictionary_size) != (0)) __PYX_ERR(0, 3000, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_null_fallback);
  __Pyx_GIVEREF(__pyx_v_null_fallback);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_null_fallback) != (0)) __PYX_ERR(0, 3000, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_schema);
  __Pyx_GIVEREF(__pyx_v_schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_schema) != (0)) __PYX_ERR(0, 3000, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segment_encoding);
  __Pyx_GIVEREF(__pyx_v_segment_encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_segment_encoding) != (0)) __PYX_ERR(0, 3000, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":2997
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CHivePartitioning.MakeFactory(c_options),
 *             _constructor_hive_partitioning_factory,
*/
  __pyx_t_4 = __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(arrow::dataset::HivePartitioning::MakeFactory(__pyx_v_c_options), __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":2940
 *         )
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.HivePartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_infer_dictionary);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3005
 * 
 * 
 * def _constructor_filename_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return FilenamePartitioning.discover(*args)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11_constructor_filename_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_10_constructor_filename_partitioning_factory, "_constructor_filename_partitioning_factory(*args)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_11_constructor_filename_partitioning_factory = {"_constructor_filename_partitioning_factory", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_8_dataset_11_constructor_filename_partitioning_factory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10_constructor_filename_partitioning_factory};
static PyObject *__pyx_pw_7pyarrow_8_dataset_11_constructor_filename_partitioning_factory(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_constructor_filename_partitioning_factory (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_constructor_filename_partitioning_factory", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_10_constructor_filename_partitioning_factory(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_10_constructor_filename_partitioning_factory(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_constructor_filename_partitioning_factory", 0);

  /* "pyarrow/_dataset.pyx":3006
 * 
 * def _constructor_filename_partitioning_factory(*args):
 *     return FilenamePartitioning.discover(*args)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning), __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3006, __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(0, 3006, __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/_dataset.pyx":3005
 * 
 * 
 * def _constructor_filename_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return FilenamePartitioning.discover(*args)
 * 
*/

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

/* "pyarrow/_dataset.pyx":3047
 *         CFilenamePartitioning* filename_partitioning
 * 
 *     def __init__(self, Schema schema not None, dictionaries=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         cdef:
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_dictionaries = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_dictionaries,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3047, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 3047, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, i); __PYX_ERR(0, 3047, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3047, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_dictionaries = values[1];
    __pyx_v_segment_encoding = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 3047, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FilenamePartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 3047, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning___init__(((struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *)__pyx_v_self), __pyx_v_schema, __pyx_v_dictionaries, __pyx_v_segment_encoding);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning___init__(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_dictionaries, PyObject *__pyx_v_segment_encoding) {
  std::shared_ptr<arrow::dataset::FilenamePartitioning>  __pyx_v_c_partitioning;
  arrow::dataset::KeyValuePartitioningOptions __pyx_v_c_options;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
   arrow::dataset::SegmentEncoding __pyx_t_2;
  std::shared_ptr< arrow::Schema>  __pyx_t_3;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_t_4;
  std::shared_ptr<arrow::dataset::FilenamePartitioning>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3053
 *             CKeyValuePartitioningOptions c_options
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 *         c_partitioning = make_shared[CFilenamePartitioning](
 *             pyarrow_unwrap_schema(schema),
*/
  __pyx_t_1 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 3053, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":3055
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 *         c_partitioning = make_shared[CFilenamePartitioning](
 *             pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *             _partitioning_dictionaries(schema, dictionaries),
 *             c_options,
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3055, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3056
 *         c_partitioning = make_shared[CFilenamePartitioning](
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),             # <<<<<<<<<<<<<<
 *             c_options,
 *         )
*/
  __pyx_t_4 = __pyx_f_7pyarrow_8_dataset__partitioning_dictionaries(__pyx_v_schema, __pyx_v_dictionaries); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3056, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3054
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 *         c_partitioning = make_shared[CFilenamePartitioning](             # <<<<<<<<<<<<<<
 *             pyarrow_unwrap_schema(schema),
 *             _partitioning_dictionaries(schema, dictionaries),
*/
  try {
    __pyx_t_5 = std::make_shared<arrow::dataset::FilenamePartitioning>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), __pyx_v_c_options);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3054, __pyx_L1_error)
  }
  __pyx_v_c_partitioning = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":3059
 *             c_options,
 *         )
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FilenamePartitioning *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_self), ((std::shared_ptr<arrow::dataset::Partitioning> )__pyx_v_c_partitioning)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3047
 *         CFilenamePartitioning* filename_partitioning
 * 
 *     def __init__(self, Schema schema not None, dictionaries=None,             # <<<<<<<<<<<<<<
 *                  segment_encoding="uri"):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.FilenamePartitioning.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3061
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_20FilenamePartitioning_init(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *__pyx_v_self, std::shared_ptr<arrow::dataset::Partitioning>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":3062
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init(((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3063
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):
 *         KeyValuePartitioning.init(self, sp)
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->filename_partitioning = ((arrow::dataset::FilenamePartitioning *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":3061
 *         self.init(<shared_ptr[CPartitioning]> c_partitioning)
 * 
 *     cdef init(self, const shared_ptr[CPartitioning]& sp):             # <<<<<<<<<<<<<<
 *         KeyValuePartitioning.init(self, sp)
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
*/

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

/* "pyarrow/_dataset.pyx":3065
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_3discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_20FilenamePartitioning_2discover, "FilenamePartitioning.discover(field_names=None, infer_dictionary=False, schema=None, segment_encoding='uri')\n\nDiscover a FilenamePartitioning.\n\nParameters\n----------\nfield_names : list of str\n    The names to associate with the values from the subdirectory names.\n    If schema is given, will be populated from the schema.\ninfer_dictionary : bool, default False\n    When inferring a schema for partition fields, yield dictionary\n    encoded types instead of plain types. This can be more efficient\n    when materializing virtual columns, and Expressions parsed by the\n    finished Partitioning will include dictionaries of all unique\n    inspected values for each field.\nschema : Schema, default None\n    Use this schema instead of inferring a schema from partition\n    values. Partition values will be validated against this schema\n    before accumulation into the Partitioning's dictionary.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nPartitioningFactory\n    To be used in the FileSystemFactoryOptions.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_20FilenamePartitioning_3discover = {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_3discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_20FilenamePartitioning_2discover};
static PyObject *__pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_3discover(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_field_names = 0;
  PyObject *__pyx_v_infer_dictionary = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_segment_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("discover (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field_names,&__pyx_mstate_global->__pyx_n_u_infer_dictionary,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_segment_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3065, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "discover", 0) < (0)) __PYX_ERR(0, 3065, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3066
 * 
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  schema=None, segment_encoding="uri"):
 *         """
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "pyarrow/_dataset.pyx":3067
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):             # <<<<<<<<<<<<<<
 *         """
 *         Discover a FilenamePartitioning.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":3066
 * 
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,             # <<<<<<<<<<<<<<
 *                  schema=None, segment_encoding="uri"):
 *         """
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "pyarrow/_dataset.pyx":3067
 *     @staticmethod
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):             # <<<<<<<<<<<<<<
 *         """
 *         Discover a FilenamePartitioning.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uri));
    }
    __pyx_v_field_names = values[0];
    __pyx_v_infer_dictionary = values[1];
    __pyx_v_schema = values[2];
    __pyx_v_segment_encoding = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("discover", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 3065, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FilenamePartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning_2discover(__pyx_v_field_names, __pyx_v_infer_dictionary, __pyx_v_schema, __pyx_v_segment_encoding);

  /* "pyarrow/_dataset.pyx":3065
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_20FilenamePartitioning_2discover(PyObject *__pyx_v_field_names, PyObject *__pyx_v_infer_dictionary, PyObject *__pyx_v_schema, PyObject *__pyx_v_segment_encoding) {
  arrow::dataset::PartitioningFactoryOptions __pyx_v_c_options;
  std::vector<std::string>  __pyx_v_c_field_names;
  PyObject *__pyx_8genexpr6__pyx_v_f = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_s = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr< arrow::Schema>  __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;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  std::vector<std::string>  __pyx_t_12;
  int __pyx_t_13;
   arrow::dataset::SegmentEncoding __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("discover", 0);

  /* "pyarrow/_dataset.pyx":3099
 *             vector[c_string] c_field_names
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_infer_dictionary); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3099, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3100
 * 
 *         if infer_dictionary:
 *             c_options.infer_dictionary = True             # <<<<<<<<<<<<<<
 * 
 *         if schema:
*/
    __pyx_v_c_options.infer_dictionary = 1;

    /* "pyarrow/_dataset.pyx":3099
 *             vector[c_string] c_field_names
 * 
 *         if infer_dictionary:             # <<<<<<<<<<<<<<
 *             c_options.infer_dictionary = True
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":3102
 *             c_options.infer_dictionary = True
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_schema); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3102, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3103
 * 
 *         if schema:
 *             c_options.schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:
*/
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(__pyx_v_schema); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3103, __pyx_L1_error)
    __pyx_v_c_options.schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

    /* "pyarrow/_dataset.pyx":3104
 *         if schema:
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]             # <<<<<<<<<<<<<<
 *         elif not field_names:
 *             raise TypeError(
*/
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3104, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_schema)) || PyTuple_CheckExact(__pyx_v_schema)) {
        __pyx_t_4 = __pyx_v_schema; __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_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3104, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3104, __pyx_L7_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3104, __pyx_L7_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_5;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3104, __pyx_L7_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5);
            #endif
            ++__pyx_t_5;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3104, __pyx_L7_error)
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3104, __pyx_L7_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_f, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3104, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_f, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3104, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
          assert(__pyx_t_8);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3104, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3104, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_f); __pyx_8genexpr6__pyx_v_f = 0;
      goto __pyx_L11_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_f); __pyx_8genexpr6__pyx_v_f = 0;
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_t_12 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_field_names = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12);

    /* "pyarrow/_dataset.pyx":3102
 *             c_options.infer_dictionary = True
 * 
 *         if schema:             # <<<<<<<<<<<<<<
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
*/
    goto __pyx_L4;
  }

  /* "pyarrow/_dataset.pyx":3105
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Neither field_names nor schema was passed; "
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_field_names); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3105, __pyx_L1_error)
  __pyx_t_13 = (!__pyx_t_1);
  if (unlikely(__pyx_t_13)) {

    /* "pyarrow/_dataset.pyx":3106
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "Neither field_names nor schema was passed; "
 *                 "cannot infer field_names")
*/
    __pyx_t_4 = NULL;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Neither_field_names_nor_schema_w};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3106, __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(0, 3106, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3105
 *             c_options.schema = pyarrow_unwrap_schema(schema)
 *             c_field_names = [tobytes(f.name) for f in schema]
 *         elif not field_names:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "Neither field_names nor schema was passed; "
*/
  }

  /* "pyarrow/_dataset.pyx":3110
 *                 "cannot infer field_names")
 *         else:
 *             c_field_names = [tobytes(s) for s in field_names]             # <<<<<<<<<<<<<<
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
*/
  /*else*/ {
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3110, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_v_field_names)) || PyTuple_CheckExact(__pyx_v_field_names)) {
        __pyx_t_4 = __pyx_v_field_names; __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_field_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3110, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3110, __pyx_L14_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3110, __pyx_L14_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_5;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3110, __pyx_L14_error)
              #endif
              if (__pyx_t_5 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_5);
            #endif
            ++__pyx_t_5;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3110, __pyx_L14_error)
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3110, __pyx_L14_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3110, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_8genexpr7__pyx_v_s};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3110, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3110, __pyx_L14_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_s); __pyx_8genexpr7__pyx_v_s = 0;
      goto __pyx_L18_exit_scope;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0;
      goto __pyx_L1_error;
      __pyx_L18_exit_scope:;
    } /* exit inner scope */
    __pyx_t_12 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3110, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_field_names = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12);
  }
  __pyx_L4:;

  /* "pyarrow/_dataset.pyx":3112
 *             c_field_names = [tobytes(s) for s in field_names]
 * 
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)             # <<<<<<<<<<<<<<
 * 
 *         return PartitioningFactory.wrap(
*/
  __pyx_t_3 = __pyx_v_segment_encoding;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 3112, __pyx_L1_error)
  __pyx_t_14 = __pyx_f_7pyarrow_8_dataset__get_segment_encoding(((PyObject*)__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c_options.segment_encoding = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

  /* "pyarrow/_dataset.pyx":3114
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CFilenamePartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_filename_partitioning_factory,
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":3116
 *         return PartitioningFactory.wrap(
 *             CFilenamePartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_filename_partitioning_factory,             # <<<<<<<<<<<<<<
 *             (field_names, infer_dictionary, schema, segment_encoding)
 *         )
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constructor_filename_partitioni); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":3117
 *             CFilenamePartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_filename_partitioning_factory,
 *             (field_names, infer_dictionary, schema, segment_encoding)             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_field_names);
  __Pyx_GIVEREF(__pyx_v_field_names);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field_names) != (0)) __PYX_ERR(0, 3117, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_infer_dictionary);
  __Pyx_GIVEREF(__pyx_v_infer_dictionary);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_infer_dictionary) != (0)) __PYX_ERR(0, 3117, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_schema);
  __Pyx_GIVEREF(__pyx_v_schema);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_schema) != (0)) __PYX_ERR(0, 3117, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_segment_encoding);
  __Pyx_GIVEREF(__pyx_v_segment_encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_segment_encoding) != (0)) __PYX_ERR(0, 3117, __pyx_L1_error);

  /* "pyarrow/_dataset.pyx":3114
 *         c_options.segment_encoding = _get_segment_encoding(segment_encoding)
 * 
 *         return PartitioningFactory.wrap(             # <<<<<<<<<<<<<<
 *             CFilenamePartitioning.MakeFactory(c_field_names, c_options),
 *             _constructor_filename_partitioning_factory,
*/
  __pyx_t_7 = __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(arrow::dataset::FilenamePartitioning::MakeFactory(__pyx_v_c_field_names, __pyx_v_c_options), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3065
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):
*/

  /* 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_10);
  __Pyx_AddTraceback("pyarrow._dataset.FilenamePartitioning.discover", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_f);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3127
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory___init__(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_14DatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3128
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3127
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":3130
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.factory = sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_14DatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":3131
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.factory = sp.get()
 * 
*/
  __pyx_v_self->wrapped = ((arrow::py::SharedPtrNoGIL<arrow::dataset::DatasetFactory> )__pyx_v_sp);

  /* "pyarrow/_dataset.pyx":3132
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
 *         self.wrapped = sp
 *         self.factory = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->factory = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":3130
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.factory = sp.get()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3134
 *         self.factory = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CDatasetFactory]& sp):
 *         cdef DatasetFactory self = \
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_14DatasetFactory_wrap(std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp) {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":3137
 *     cdef wrap(const shared_ptr[CDatasetFactory]& sp):
 *         cdef DatasetFactory self = \
 *             DatasetFactory.__new__(DatasetFactory)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_8_dataset_DatasetFactory(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3138
 *         cdef DatasetFactory self = \
 *             DatasetFactory.__new__(DatasetFactory)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3139
 *             DatasetFactory.__new__(DatasetFactory)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CDatasetFactory] unwrap(self) nogil:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3134
 *         self.factory = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CDatasetFactory]& sp):
 *         cdef DatasetFactory self = \
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3141
 *         return self
 * 
 *     cdef inline shared_ptr[CDatasetFactory] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_f_7pyarrow_8_dataset_14DatasetFactory_unwrap(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_r;

  /* "pyarrow/_dataset.pyx":3142
 * 
 *     cdef inline shared_ptr[CDatasetFactory] unwrap(self) nogil:
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3141
 *         return self
 * 
 *     cdef inline shared_ptr[CDatasetFactory] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3144
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def root_partition(self):
 *         return Expression.wrap(self.factory.root_partition())
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition___get__(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition___get__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3146
 *     @property
 *     def root_partition(self):
 *         return Expression.wrap(self.factory.root_partition())             # <<<<<<<<<<<<<<
 * 
 *     @root_partition.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_vtabptr_7pyarrow_8_compute_Expression->wrap(__pyx_v_self->factory->root_partition()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3144
 *         return self.wrapped
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def root_partition(self):
 *         return Expression.wrap(self.factory.root_partition())
*/

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

/* "pyarrow/_dataset.pyx":3148
 *         return Expression.wrap(self.factory.root_partition())
 * 
 *     @root_partition.setter             # <<<<<<<<<<<<<<
 *     def root_partition(self, Expression expr):
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_expr); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_expr) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_expr), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "expr", 0))) __PYX_ERR(0, 3149, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_expr));

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

static int __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_14root_partition_2__set__(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_expr) {
  int __pyx_r;
  arrow::compute::Expression __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":3150
 *     @root_partition.setter
 *     def root_partition(self, Expression expr):
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))             # <<<<<<<<<<<<<<
 * 
 *     def inspect_schemas(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *)__pyx_v_expr->__pyx_vtab)->unwrap(__pyx_v_expr); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3150, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->factory->SetRootPartition(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 3150, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3148
 *         return Expression.wrap(self.factory.root_partition())
 * 
 *     @root_partition.setter             # <<<<<<<<<<<<<<
 *     def root_partition(self, Expression expr):
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.root_partition.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3152
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))
 * 
 *     def inspect_schemas(self):             # <<<<<<<<<<<<<<
 *         cdef CResult[vector[shared_ptr[CSchema]]] result
 *         cdef CInspectOptions options
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas, "DatasetFactory.inspect_schemas(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas = {"inspect_schemas", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inspect_schemas (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("inspect_schemas", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("inspect_schemas", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self) {
  arrow::Result<std::vector<std::shared_ptr< arrow::Schema> > >  __pyx_v_result;
  arrow::dataset::InspectOptions __pyx_v_options;
  PyObject *__pyx_v_schemas = NULL;
  std::shared_ptr< arrow::Schema>  __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::shared_ptr< arrow::Schema> >  __pyx_t_2;
  std::vector<std::shared_ptr< arrow::Schema> > ::iterator __pyx_t_3;
  std::vector<std::shared_ptr< arrow::Schema> >  __pyx_t_4;
  std::shared_ptr< arrow::Schema>  __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inspect_schemas", 0);

  /* "pyarrow/_dataset.pyx":3155
 *         cdef CResult[vector[shared_ptr[CSchema]]] result
 *         cdef CInspectOptions options
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.factory.InspectSchemas(options)
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3156
 *         cdef CInspectOptions options
 *         with nogil:
 *             result = self.factory.InspectSchemas(options)             # <<<<<<<<<<<<<<
 * 
 *         schemas = []
*/
        __pyx_v_result = __pyx_v_self->factory->InspectSchemas(__pyx_v_options);
      }

      /* "pyarrow/_dataset.pyx":3155
 *         cdef CResult[vector[shared_ptr[CSchema]]] result
 *         cdef CInspectOptions options
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.factory.InspectSchemas(options)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":3158
 *             result = self.factory.InspectSchemas(options)
 * 
 *         schemas = []             # <<<<<<<<<<<<<<
 *         for s in GetResultValue(result):
 *             schemas.append(pyarrow_wrap_schema(s))
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_schemas = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3159
 * 
 *         schemas = []
 *         for s in GetResultValue(result):             # <<<<<<<<<<<<<<
 *             schemas.append(pyarrow_wrap_schema(s))
 *         return schemas
*/
  __pyx_t_2 = arrow::py::GetResultValue<std::vector<std::shared_ptr< arrow::Schema> > >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3159, __pyx_L1_error)
  __pyx_t_4 = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);
  __pyx_t_3 = __pyx_t_4.begin();
  for (; __pyx_t_3 != __pyx_t_4.end(); ++__pyx_t_3) {
    __pyx_t_5 = *__pyx_t_3;
    __pyx_v_s = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

    /* "pyarrow/_dataset.pyx":3160
 *         schemas = []
 *         for s in GetResultValue(result):
 *             schemas.append(pyarrow_wrap_schema(s))             # <<<<<<<<<<<<<<
 *         return schemas
 * 
*/
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_schemas, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 3160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":3159
 * 
 *         schemas = []
 *         for s in GetResultValue(result):             # <<<<<<<<<<<<<<
 *             schemas.append(pyarrow_wrap_schema(s))
 *         return schemas
*/
  }

  /* "pyarrow/_dataset.pyx":3161
 *         for s in GetResultValue(result):
 *             schemas.append(pyarrow_wrap_schema(s))
 *         return schemas             # <<<<<<<<<<<<<<
 * 
 *     def inspect(self, *, promote_options="default", fragments=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_schemas);
  __pyx_r = __pyx_v_schemas;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3152
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))
 * 
 *     def inspect_schemas(self):             # <<<<<<<<<<<<<<
 *         cdef CResult[vector[shared_ptr[CSchema]]] result
 *         cdef CInspectOptions options
*/

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

/* "pyarrow/_dataset.pyx":3163
 *         return schemas
 * 
 *     def inspect(self, *, promote_options="default", fragments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Inspect data fragments and return a common Schema.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_5inspect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14DatasetFactory_4inspect, "DatasetFactory.inspect(self, *, promote_options='default', fragments=None)\n\nInspect data fragments and return a common Schema.\n\nParameters\n----------\npromote_options : str, default \"default\"\n    Control how to unify types. Accepts strings \"default\" and \"permissive\".\n    Default: types must match exactly, except nulls can be merged with other types.\n    Permissive: types are promoted when possible.\nfragments : int, default None\n    How many fragments should be inspected to infer the unified schema.\n    Use ``None`` to inspect all fragments.\n\nReturns\n-------\nSchema");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_5inspect = {"inspect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_5inspect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_4inspect};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_5inspect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_promote_options = 0;
  PyObject *__pyx_v_fragments = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inspect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_promote_options,&__pyx_mstate_global->__pyx_n_u_fragments,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3163, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, 0, __pyx_kwds_len, "inspect", 0) < (0)) __PYX_ERR(0, 3163, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_default));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else if (unlikely(__pyx_nargs != 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_default));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_promote_options = values[0];
    __pyx_v_fragments = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inspect", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 3163, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.inspect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_4inspect(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_v_promote_options, __pyx_v_fragments);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_4inspect(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, PyObject *__pyx_v_promote_options, PyObject *__pyx_v_fragments) {
  arrow::dataset::InspectOptions __pyx_v_options;
  arrow::Result<std::shared_ptr< arrow::Schema> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
   arrow::Field::MergeOptions __pyx_t_2;
  int __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;
  size_t __pyx_t_9;
  std::shared_ptr< arrow::Schema>  __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("inspect", 0);

  /* "pyarrow/_dataset.pyx":3185
 *             CResult[shared_ptr[CSchema]] result
 * 
 *         options.field_merge_options = _parse_field_merge_options(promote_options)             # <<<<<<<<<<<<<<
 * 
 *         if fragments is None:
*/
  __pyx_t_1 = __pyx_v_promote_options;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 3185, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__parse_field_merge_options(((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_options.field_merge_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":3187
 *         options.field_merge_options = _parse_field_merge_options(promote_options)
 * 
 *         if fragments is None:             # <<<<<<<<<<<<<<
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments
 *         elif isinstance(fragments, int) and fragments >= 0:
*/
  __pyx_t_3 = (__pyx_v_fragments == Py_None);
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":3188
 * 
 *         if fragments is None:
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments             # <<<<<<<<<<<<<<
 *         elif isinstance(fragments, int) and fragments >= 0:
 *             options.fragments = fragments
*/
    __pyx_v_options.fragments = -1;

    /* "pyarrow/_dataset.pyx":3187
 *         options.field_merge_options = _parse_field_merge_options(promote_options)
 * 
 *         if fragments is None:             # <<<<<<<<<<<<<<
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments
 *         elif isinstance(fragments, int) and fragments >= 0:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3189
 *         if fragments is None:
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments
 *         elif isinstance(fragments, int) and fragments >= 0:             # <<<<<<<<<<<<<<
 *             options.fragments = fragments
 *         else:
*/
  __pyx_t_4 = PyLong_Check(__pyx_v_fragments); 
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_fragments, __pyx_mstate_global->__pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_3)) {

    /* "pyarrow/_dataset.pyx":3190
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments
 *         elif isinstance(fragments, int) and fragments >= 0:
 *             options.fragments = fragments             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(
*/
    __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_fragments); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3190, __pyx_L1_error)
    __pyx_v_options.fragments = __pyx_t_5;

    /* "pyarrow/_dataset.pyx":3189
 *         if fragments is None:
 *             options.fragments = -1  # InspectOptions::kInspectAllFragments
 *         elif isinstance(fragments, int) and fragments >= 0:             # <<<<<<<<<<<<<<
 *             options.fragments = fragments
 *         else:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3192
 *             options.fragments = fragments
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f"Fragment count must be a non-negative int or None; got {fragments!r}")
 * 
*/
  /*else*/ {
    __pyx_t_6 = NULL;

    /* "pyarrow/_dataset.pyx":3193
 *         else:
 *             raise ValueError(
 *                 f"Fragment count must be a non-negative int or None; got {fragments!r}")             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fragments), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Fragment_count_must_be_a_non_neg, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3192, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":3195
 *                 f"Fragment count must be a non-negative int or None; got {fragments!r}")
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.factory.Inspect(options)
 *         return pyarrow_wrap_schema(GetResultValue(result))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3196
 * 
 *         with nogil:
 *             result = self.factory.Inspect(options)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(GetResultValue(result))
 * 
*/
        __pyx_v_result = __pyx_v_self->factory->Inspect(__pyx_v_options);
      }

      /* "pyarrow/_dataset.pyx":3195
 *                 f"Fragment count must be a non-negative int or None; got {fragments!r}")
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.factory.Inspect(options)
 *         return pyarrow_wrap_schema(GetResultValue(result))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/_dataset.pyx":3197
 *         with nogil:
 *             result = self.factory.Inspect(options)
 *         return pyarrow_wrap_schema(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     def finish(self, Schema schema=None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = arrow::py::GetResultValue<std::shared_ptr< arrow::Schema> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3197, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3163
 *         return schemas
 * 
 *     def inspect(self, *, promote_options="default", fragments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Inspect data fragments and return a common Schema.
*/

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

/* "pyarrow/_dataset.pyx":3199
 *         return pyarrow_wrap_schema(GetResultValue(result))
 * 
 *     def finish(self, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Dataset using the inspected schema or an explicit schema
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_7finish(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14DatasetFactory_6finish, "DatasetFactory.finish(self, Schema schema=None)\n\nCreate a Dataset using the inspected schema or an explicit schema\n(if given).\n\nParameters\n----------\nschema : Schema, default None\n    The schema to conform the source to.  If None, the inspected\n    schema is used.\n\nReturns\n-------\nDataset");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_7finish = {"finish", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_7finish, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_6finish};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_7finish(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_schema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3199, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3199, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "finish", 0) < (0)) __PYX_ERR(0, 3199, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3199, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("finish", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 3199, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 3199, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_6finish(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_6finish(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::shared_ptr< arrow::Schema>  __pyx_v_sp_schema;
  arrow::Result<std::shared_ptr<arrow::dataset::Dataset> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::shared_ptr< arrow::Schema>  __pyx_t_2;
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "pyarrow/_dataset.pyx":3218
 *             CResult[shared_ptr[CDataset]] result
 * 
 *         if schema is not None:             # <<<<<<<<<<<<<<
 *             sp_schema = pyarrow_unwrap_schema(schema)
 *             with nogil:
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_schema) != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3219
 * 
 *         if schema is not None:
 *             sp_schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 result = self.factory.FinishWithSchema(sp_schema)
*/
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3219, __pyx_L1_error)
    __pyx_v_sp_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

    /* "pyarrow/_dataset.pyx":3220
 *         if schema is not None:
 *             sp_schema = pyarrow_unwrap_schema(schema)
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.factory.FinishWithSchema(sp_schema)
 *         else:
*/
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_dataset.pyx":3221
 *             sp_schema = pyarrow_unwrap_schema(schema)
 *             with nogil:
 *                 result = self.factory.FinishWithSchema(sp_schema)             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
*/
          __pyx_v_result = __pyx_v_self->factory->Finish(__pyx_v_sp_schema);
        }

        /* "pyarrow/_dataset.pyx":3220
 *         if schema is not None:
 *             sp_schema = pyarrow_unwrap_schema(schema)
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.factory.FinishWithSchema(sp_schema)
 *         else:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pyarrow/_dataset.pyx":3218
 *             CResult[shared_ptr[CDataset]] result
 * 
 *         if schema is not None:             # <<<<<<<<<<<<<<
 *             sp_schema = pyarrow_unwrap_schema(schema)
 *             with nogil:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3223
 *                 result = self.factory.FinishWithSchema(sp_schema)
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.factory.Finish()
 * 
*/
  /*else*/ {
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_dataset.pyx":3224
 *         else:
 *             with nogil:
 *                 result = self.factory.Finish()             # <<<<<<<<<<<<<<
 * 
 *         return Dataset.wrap(GetResultValue(result))
*/
          __pyx_v_result = __pyx_v_self->factory->Finish();
        }

        /* "pyarrow/_dataset.pyx":3223
 *                 result = self.factory.FinishWithSchema(sp_schema)
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 result = self.factory.Finish()
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L9;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":3226
 *                 result = self.factory.Finish()
 * 
 *         return Dataset.wrap(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Dataset> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3226, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_7pyarrow_8_dataset_7Dataset_wrap(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3199
 *         return pyarrow_wrap_schema(GetResultValue(result))
 * 
 *     def finish(self, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Dataset using the inspected schema or an explicit schema
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.finish", __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.factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__, "DatasetFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.__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.factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__, "DatasetFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.DatasetFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3261
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,             # <<<<<<<<<<<<<<
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_partition_base_dir = 0;
  PyObject *__pyx_v_partitioning = 0;
  PyObject *__pyx_v_exclude_invalid_files = 0;
  PyObject *__pyx_v_selector_ignore_prefixes = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_partition_base_dir,&__pyx_mstate_global->__pyx_n_u_partitioning,&__pyx_mstate_global->__pyx_n_u_exclude_invalid_files,&__pyx_mstate_global->__pyx_n_u_selector_ignore_prefixes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3261, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 3261, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3262
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,
 *                  exclude_invalid_files=None,             # <<<<<<<<<<<<<<
 *                  list selector_ignore_prefixes=None):
 *         if isinstance(partitioning, PartitioningFactory):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3263
 *     def __init__(self, partition_base_dir=None, partitioning=None,
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):             # <<<<<<<<<<<<<<
 *         if isinstance(partitioning, PartitioningFactory):
 *             self.partitioning_factory = partitioning
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_dataset.pyx":3261
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,             # <<<<<<<<<<<<<<
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3262
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,
 *                  exclude_invalid_files=None,             # <<<<<<<<<<<<<<
 *                  list selector_ignore_prefixes=None):
 *         if isinstance(partitioning, PartitioningFactory):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3263
 *     def __init__(self, partition_base_dir=None, partitioning=None,
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):             # <<<<<<<<<<<<<<
 *         if isinstance(partitioning, PartitioningFactory):
 *             self.partitioning_factory = partitioning
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_partition_base_dir = values[0];
    __pyx_v_partitioning = values[1];
    __pyx_v_exclude_invalid_files = values[2];
    __pyx_v_selector_ignore_prefixes = ((PyObject*)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 3261, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector_ignore_prefixes), (&PyList_Type), 1, "selector_ignore_prefixes", 1))) __PYX_ERR(0, 3263, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions___init__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), __pyx_v_partition_base_dir, __pyx_v_partitioning, __pyx_v_exclude_invalid_files, __pyx_v_selector_ignore_prefixes);

  /* "pyarrow/_dataset.pyx":3261
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,             # <<<<<<<<<<<<<<
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_partition_base_dir, PyObject *__pyx_v_partitioning, PyObject *__pyx_v_exclude_invalid_files, PyObject *__pyx_v_selector_ignore_prefixes) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":3264
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
 *         if isinstance(partitioning, PartitioningFactory):             # <<<<<<<<<<<<<<
 *             self.partitioning_factory = partitioning
 *         elif isinstance(partitioning, Partitioning):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_partitioning, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory); 
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3265
 *                  list selector_ignore_prefixes=None):
 *         if isinstance(partitioning, PartitioningFactory):
 *             self.partitioning_factory = partitioning             # <<<<<<<<<<<<<<
 *         elif isinstance(partitioning, Partitioning):
 *             self.partitioning = partitioning
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partitioning_factory, __pyx_v_partitioning) < (0)) __PYX_ERR(0, 3265, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3264
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
 *         if isinstance(partitioning, PartitioningFactory):             # <<<<<<<<<<<<<<
 *             self.partitioning_factory = partitioning
 *         elif isinstance(partitioning, Partitioning):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3266
 *         if isinstance(partitioning, PartitioningFactory):
 *             self.partitioning_factory = partitioning
 *         elif isinstance(partitioning, Partitioning):             # <<<<<<<<<<<<<<
 *             self.partitioning = partitioning
 * 
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_partitioning, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning); 
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3267
 *             self.partitioning_factory = partitioning
 *         elif isinstance(partitioning, Partitioning):
 *             self.partitioning = partitioning             # <<<<<<<<<<<<<<
 * 
 *         if partition_base_dir is not None:
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partitioning, __pyx_v_partitioning) < (0)) __PYX_ERR(0, 3267, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3266
 *         if isinstance(partitioning, PartitioningFactory):
 *             self.partitioning_factory = partitioning
 *         elif isinstance(partitioning, Partitioning):             # <<<<<<<<<<<<<<
 *             self.partitioning = partitioning
 * 
*/
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":3269
 *             self.partitioning = partitioning
 * 
 *         if partition_base_dir is not None:             # <<<<<<<<<<<<<<
 *             self.partition_base_dir = partition_base_dir
 *         if exclude_invalid_files is not None:
*/
  __pyx_t_1 = (__pyx_v_partition_base_dir != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3270
 * 
 *         if partition_base_dir is not None:
 *             self.partition_base_dir = partition_base_dir             # <<<<<<<<<<<<<<
 *         if exclude_invalid_files is not None:
 *             self.exclude_invalid_files = exclude_invalid_files
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_partition_base_dir, __pyx_v_partition_base_dir) < (0)) __PYX_ERR(0, 3270, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3269
 *             self.partitioning = partitioning
 * 
 *         if partition_base_dir is not None:             # <<<<<<<<<<<<<<
 *             self.partition_base_dir = partition_base_dir
 *         if exclude_invalid_files is not None:
*/
  }

  /* "pyarrow/_dataset.pyx":3271
 *         if partition_base_dir is not None:
 *             self.partition_base_dir = partition_base_dir
 *         if exclude_invalid_files is not None:             # <<<<<<<<<<<<<<
 *             self.exclude_invalid_files = exclude_invalid_files
 *         if selector_ignore_prefixes is not None:
*/
  __pyx_t_1 = (__pyx_v_exclude_invalid_files != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3272
 *             self.partition_base_dir = partition_base_dir
 *         if exclude_invalid_files is not None:
 *             self.exclude_invalid_files = exclude_invalid_files             # <<<<<<<<<<<<<<
 *         if selector_ignore_prefixes is not None:
 *             self.selector_ignore_prefixes = selector_ignore_prefixes
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_exclude_invalid_files, __pyx_v_exclude_invalid_files) < (0)) __PYX_ERR(0, 3272, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3271
 *         if partition_base_dir is not None:
 *             self.partition_base_dir = partition_base_dir
 *         if exclude_invalid_files is not None:             # <<<<<<<<<<<<<<
 *             self.exclude_invalid_files = exclude_invalid_files
 *         if selector_ignore_prefixes is not None:
*/
  }

  /* "pyarrow/_dataset.pyx":3273
 *         if exclude_invalid_files is not None:
 *             self.exclude_invalid_files = exclude_invalid_files
 *         if selector_ignore_prefixes is not None:             # <<<<<<<<<<<<<<
 *             self.selector_ignore_prefixes = selector_ignore_prefixes
 * 
*/
  __pyx_t_1 = (__pyx_v_selector_ignore_prefixes != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3274
 *             self.exclude_invalid_files = exclude_invalid_files
 *         if selector_ignore_prefixes is not None:
 *             self.selector_ignore_prefixes = selector_ignore_prefixes             # <<<<<<<<<<<<<<
 * 
 *     cdef inline CFileSystemFactoryOptions unwrap(self):
*/
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_selector_ignore_prefixes, __pyx_v_selector_ignore_prefixes) < (0)) __PYX_ERR(0, 3274, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3273
 *         if exclude_invalid_files is not None:
 *             self.exclude_invalid_files = exclude_invalid_files
 *         if selector_ignore_prefixes is not None:             # <<<<<<<<<<<<<<
 *             self.selector_ignore_prefixes = selector_ignore_prefixes
 * 
*/
  }

  /* "pyarrow/_dataset.pyx":3261
 *     __slots__ = ()  # avoid mistakingly creating attributes
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,             # <<<<<<<<<<<<<<
 *                  exclude_invalid_files=None,
 *                  list selector_ignore_prefixes=None):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3276
 *             self.selector_ignore_prefixes = selector_ignore_prefixes
 * 
 *     cdef inline CFileSystemFactoryOptions unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.options
 * 
*/

static CYTHON_INLINE arrow::dataset::FileSystemFactoryOptions __pyx_f_7pyarrow_8_dataset_24FileSystemFactoryOptions_unwrap(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  arrow::dataset::FileSystemFactoryOptions __pyx_r;

  /* "pyarrow/_dataset.pyx":3277
 * 
 *     cdef inline CFileSystemFactoryOptions unwrap(self):
 *         return self.options             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_r = __pyx_v_self->options;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3276
 *             self.selector_ignore_prefixes = selector_ignore_prefixes
 * 
 *     cdef inline CFileSystemFactoryOptions unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.options
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3279
 *         return self.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning(self):
 *         """Partitioning to apply to discovered files.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_v_c_partitioning;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3285
 *         NOTE: setting this property will overwrite partitioning_factory.
 *         """
 *         c_partitioning = self.options.partitioning.partitioning()             # <<<<<<<<<<<<<<
 *         if c_partitioning.get() == nullptr:
 *             return None
*/
  __pyx_v_c_partitioning = __pyx_v_self->options.partitioning.partitioning();

  /* "pyarrow/_dataset.pyx":3286
 *         """
 *         c_partitioning = self.options.partitioning.partitioning()
 *         if c_partitioning.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         return Partitioning.wrap(c_partitioning)
*/
  __pyx_t_1 = (__pyx_v_c_partitioning.get() == nullptr);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3287
 *         c_partitioning = self.options.partitioning.partitioning()
 *         if c_partitioning.get() == nullptr:
 *             return None             # <<<<<<<<<<<<<<
 *         return Partitioning.wrap(c_partitioning)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":3286
 *         """
 *         c_partitioning = self.options.partitioning.partitioning()
 *         if c_partitioning.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         return Partitioning.wrap(c_partitioning)
*/
  }

  /* "pyarrow/_dataset.pyx":3288
 *         if c_partitioning.get() == nullptr:
 *             return None
 *         return Partitioning.wrap(c_partitioning)             # <<<<<<<<<<<<<<
 * 
 *     @partitioning.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_12Partitioning_wrap(__pyx_v_c_partitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3279
 *         return self.options
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning(self):
 *         """Partitioning to apply to discovered files.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.partitioning.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3290
 *         return Partitioning.wrap(c_partitioning)
 * 
 *     @partitioning.setter             # <<<<<<<<<<<<<<
 *     def partitioning(self, Partitioning value):
 *         self.options.partitioning = (<Partitioning> value).unwrap()
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning, 1, "value", 0))) __PYX_ERR(0, 3291, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_value) {
  int __pyx_r;
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":3292
 *     @partitioning.setter
 *     def partitioning(self, Partitioning value):
 *         self.options.partitioning = (<Partitioning> value).unwrap()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3292, __pyx_L1_error)
  __pyx_v_self->options.partitioning = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::dataset::PartitioningOrFactory)__pyx_t_1));

  /* "pyarrow/_dataset.pyx":3290
 *         return Partitioning.wrap(c_partitioning)
 * 
 *     @partitioning.setter             # <<<<<<<<<<<<<<
 *     def partitioning(self, Partitioning value):
 *         self.options.partitioning = (<Partitioning> value).unwrap()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.partitioning.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3294
 *         self.options.partitioning = (<Partitioning> value).unwrap()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning_factory(self):
 *         """PartitioningFactory to apply to discovered files and
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_v_c_factory;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3301
 *         NOTE: setting this property will overwrite partitioning.
 *         """
 *         c_factory = self.options.partitioning.factory()             # <<<<<<<<<<<<<<
 *         if c_factory.get() == nullptr:
 *             return None
*/
  __pyx_v_c_factory = __pyx_v_self->options.partitioning.factory();

  /* "pyarrow/_dataset.pyx":3302
 *         """
 *         c_factory = self.options.partitioning.factory()
 *         if c_factory.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         return PartitioningFactory.wrap(c_factory, None, None)
*/
  __pyx_t_1 = (__pyx_v_c_factory.get() == nullptr);
  if (__pyx_t_1) {

    /* "pyarrow/_dataset.pyx":3303
 *         c_factory = self.options.partitioning.factory()
 *         if c_factory.get() == nullptr:
 *             return None             # <<<<<<<<<<<<<<
 *         return PartitioningFactory.wrap(c_factory, None, None)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_dataset.pyx":3302
 *         """
 *         c_factory = self.options.partitioning.factory()
 *         if c_factory.get() == nullptr:             # <<<<<<<<<<<<<<
 *             return None
 *         return PartitioningFactory.wrap(c_factory, None, None)
*/
  }

  /* "pyarrow/_dataset.pyx":3304
 *         if c_factory.get() == nullptr:
 *             return None
 *         return PartitioningFactory.wrap(c_factory, None, None)             # <<<<<<<<<<<<<<
 * 
 *     @partitioning_factory.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap(__pyx_v_c_factory, Py_None, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3294
 *         self.options.partitioning = (<Partitioning> value).unwrap()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partitioning_factory(self):
 *         """PartitioningFactory to apply to discovered files and
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.partitioning_factory.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3306
 *         return PartitioningFactory.wrap(c_factory, None, None)
 * 
 *     @partitioning_factory.setter             # <<<<<<<<<<<<<<
 *     def partitioning_factory(self, PartitioningFactory value):
 *         self.options.partitioning = (<PartitioningFactory> value).unwrap()
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory, 1, "value", 0))) __PYX_ERR(0, 3307, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *__pyx_v_value) {
  int __pyx_r;
  std::shared_ptr<arrow::dataset::PartitioningFactory>  __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_dataset.pyx":3308
 *     @partitioning_factory.setter
 *     def partitioning_factory(self, PartitioningFactory value):
 *         self.options.partitioning = (<PartitioningFactory> value).unwrap()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_19PartitioningFactory_unwrap(((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3308, __pyx_L1_error)
  __pyx_v_self->options.partitioning = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::dataset::PartitioningOrFactory)__pyx_t_1));

  /* "pyarrow/_dataset.pyx":3306
 *         return PartitioningFactory.wrap(c_factory, None, None)
 * 
 *     @partitioning_factory.setter             # <<<<<<<<<<<<<<
 *     def partitioning_factory(self, PartitioningFactory value):
 *         self.options.partitioning = (<PartitioningFactory> value).unwrap()
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.partitioning_factory.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3310
 *         self.options.partitioning = (<PartitioningFactory> value).unwrap()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_base_dir(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3315
 *         Base directory to strip paths before applying the partitioning.
 *         """
 *         return frombytes(self.options.partition_base_dir)             # <<<<<<<<<<<<<<
 * 
 *     @partition_base_dir.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->options.partition_base_dir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3310
 *         self.options.partitioning = (<PartitioningFactory> value).unwrap()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def partition_base_dir(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_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.partition_base_dir.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3317
 *         return frombytes(self.options.partition_base_dir)
 * 
 *     @partition_base_dir.setter             # <<<<<<<<<<<<<<
 *     def partition_base_dir(self, value):
 *         self.options.partition_base_dir = tobytes(value)
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/_dataset.pyx":3319
 *     @partition_base_dir.setter
 *     def partition_base_dir(self, value):
 *         self.options.partition_base_dir = tobytes(value)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->options.partition_base_dir = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":3317
 *         return frombytes(self.options.partition_base_dir)
 * 
 *     @partition_base_dir.setter             # <<<<<<<<<<<<<<
 *     def partition_base_dir(self, value):
 *         self.options.partition_base_dir = tobytes(value)
*/

  /* 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._dataset.FileSystemFactoryOptions.partition_base_dir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3321
 *         self.options.partition_base_dir = tobytes(value)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def exclude_invalid_files(self):
 *         """Whether to exclude invalid files."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3324
 *     def exclude_invalid_files(self):
 *         """Whether to exclude invalid files."""
 *         return self.options.exclude_invalid_files             # <<<<<<<<<<<<<<
 * 
 *     @exclude_invalid_files.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->options.exclude_invalid_files); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3321
 *         self.options.partition_base_dir = tobytes(value)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def exclude_invalid_files(self):
 *         """Whether to exclude invalid files."""
*/

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

/* "pyarrow/_dataset.pyx":3326
 *         return self.options.exclude_invalid_files
 * 
 *     @exclude_invalid_files.setter             # <<<<<<<<<<<<<<
 *     def exclude_invalid_files(self, bint value):
 *         self.options.exclude_invalid_files = value
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyObject_IsTrue(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3327, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.exclude_invalid_files.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), ((int)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, int __pyx_v_value) {
  int __pyx_r;

  /* "pyarrow/_dataset.pyx":3328
 *     @exclude_invalid_files.setter
 *     def exclude_invalid_files(self, bint value):
 *         self.options.exclude_invalid_files = value             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_v_self->options.exclude_invalid_files = __pyx_v_value;

  /* "pyarrow/_dataset.pyx":3326
 *         return self.options.exclude_invalid_files
 * 
 *     @exclude_invalid_files.setter             # <<<<<<<<<<<<<<
 *     def exclude_invalid_files(self, bint value):
 *         self.options.exclude_invalid_files = value
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3330
 *         self.options.exclude_invalid_files = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def selector_ignore_prefixes(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes___get__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes___get__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  std::string __pyx_8genexpr8__pyx_v_p;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector<std::string> ::iterator __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3336
 *         ignored by the discovery process.
 *         """
 *         return [frombytes(p) for p in self.options.selector_ignore_prefixes]             # <<<<<<<<<<<<<<
 * 
 *     @selector_ignore_prefixes.setter
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_self->options.selector_ignore_prefixes.begin();
    for (; __pyx_t_2 != __pyx_v_self->options.selector_ignore_prefixes.end(); ++__pyx_t_2) {
      __pyx_t_3 = *__pyx_t_2;
      __pyx_8genexpr8__pyx_v_p = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_8genexpr8__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3336, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 3336, __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/_dataset.pyx":3330
 *         self.options.exclude_invalid_files = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def selector_ignore_prefixes(self):
 *         """
*/

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

/* "pyarrow/_dataset.pyx":3338
 *         return [frombytes(p) for p in self.options.selector_ignore_prefixes]
 * 
 *     @selector_ignore_prefixes.setter             # <<<<<<<<<<<<<<
 *     def selector_ignore_prefixes(self, values):
 *         self.options.selector_ignore_prefixes = [tobytes(v) for v in values]
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), ((PyObject *)__pyx_v_values));

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

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_2__set__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_8genexpr9__pyx_v_v = NULL;
  int __pyx_r;
  __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;
  size_t __pyx_t_8;
  std::vector<std::string>  __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyarrow/_dataset.pyx":3340
 *     @selector_ignore_prefixes.setter
 *     def selector_ignore_prefixes(self, values):
 *         self.options.selector_ignore_prefixes = [tobytes(v) for v in values]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3340, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
      __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3340, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3340, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3340, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3340, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3340, __pyx_L5_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_v, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3340, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_8genexpr9__pyx_v_v};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3340, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v); __pyx_8genexpr9__pyx_v_v = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v); __pyx_8genexpr9__pyx_v_v = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_9 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->options.selector_ignore_prefixes = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":3338
 *         return [frombytes(p) for p in self.options.selector_ignore_prefixes]
 * 
 *     @selector_ignore_prefixes.setter             # <<<<<<<<<<<<<<
 *     def selector_ignore_prefixes(self, values):
 *         self.options.selector_ignore_prefixes = [tobytes(v) for v in values]
*/

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.selector_ignore_prefixes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__, "FileSystemFactoryOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_options_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__, "FileSystemFactoryOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemFactoryOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_options_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3343
 * 
 * 
 * cdef vector[CFileInfo] unwrap_finfos(finfos):             # <<<<<<<<<<<<<<
 *     cdef vector[CFileInfo] o_vect
 *     for fi in finfos:
*/

static std::vector<arrow::fs::FileInfo>  __pyx_f_7pyarrow_8_dataset_unwrap_finfos(PyObject *__pyx_v_finfos) {
  std::vector<arrow::fs::FileInfo>  __pyx_v_o_vect;
  PyObject *__pyx_v_fi = NULL;
  std::vector<arrow::fs::FileInfo>  __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;
  arrow::fs::FileInfo __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unwrap_finfos", 0);

  /* "pyarrow/_dataset.pyx":3345
 * cdef vector[CFileInfo] unwrap_finfos(finfos):
 *     cdef vector[CFileInfo] o_vect
 *     for fi in finfos:             # <<<<<<<<<<<<<<
 *         o_vect.push_back((<FileInfo> fi).unwrap())
 *     return o_vect
*/
  if (likely(PyList_CheckExact(__pyx_v_finfos)) || PyTuple_CheckExact(__pyx_v_finfos)) {
    __pyx_t_1 = __pyx_v_finfos; __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_finfos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3345, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3345, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3345, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3345, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_fi, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":3346
 *     cdef vector[CFileInfo] o_vect
 *     for fi in finfos:
 *         o_vect.push_back((<FileInfo> fi).unwrap())             # <<<<<<<<<<<<<<
 *     return o_vect
 * 
*/
    __pyx_t_5 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo *)((struct __pyx_obj_7pyarrow_3_fs_FileInfo *)__pyx_v_fi)->__pyx_vtab)->unwrap(((struct __pyx_obj_7pyarrow_3_fs_FileInfo *)__pyx_v_fi)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3346, __pyx_L1_error)
    try {
      __pyx_v_o_vect.push_back(__pyx_t_5);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3346, __pyx_L1_error)
    }

    /* "pyarrow/_dataset.pyx":3345
 * cdef vector[CFileInfo] unwrap_finfos(finfos):
 *     cdef vector[CFileInfo] o_vect
 *     for fi in finfos:             # <<<<<<<<<<<<<<
 *         o_vect.push_back((<FileInfo> fi).unwrap())
 *     return o_vect
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3347
 *     for fi in finfos:
 *         o_vect.push_back((<FileInfo> fi).unwrap())
 *     return o_vect             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_o_vect;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3343
 * 
 * 
 * cdef vector[CFileInfo] unwrap_finfos(finfos):             # <<<<<<<<<<<<<<
 *     cdef vector[CFileInfo] o_vect
 *     for fi in finfos:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.unwrap_finfos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fi);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3369
 *         CFileSystemDatasetFactory* filesystem_factory
 * 
 *     def __init__(self, FileSystem filesystem not None, paths_or_selector,             # <<<<<<<<<<<<<<
 *                  FileFormat format not None,
 *                  FileSystemFactoryOptions options=None):
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem = 0;
  PyObject *__pyx_v_paths_or_selector = 0;
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format = 0;
  struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_options = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filesystem,&__pyx_mstate_global->__pyx_n_u_paths_or_selector,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3369, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3369, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3369, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3369, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3369, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 3369, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3371
 *     def __init__(self, FileSystem filesystem not None, paths_or_selector,
 *                  FileFormat format not None,
 *                  FileSystemFactoryOptions options=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[c_string] paths
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 3369, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3369, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3369, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3369, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3369, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)Py_None));
    }
    __pyx_v_filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)values[0]);
    __pyx_v_paths_or_selector = values[1];
    __pyx_v_format = ((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)values[2]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 3369, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDatasetFactory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filesystem), __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem, 0, "filesystem", 0))) __PYX_ERR(0, 3369, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_format), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, 0, "format", 0))) __PYX_ERR(0, 3370, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions, 1, "options", 0))) __PYX_ERR(0, 3371, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory___init__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *)__pyx_v_self), __pyx_v_filesystem, __pyx_v_paths_or_selector, __pyx_v_format, __pyx_v_options);

  /* "pyarrow/_dataset.pyx":3369
 *         CFileSystemDatasetFactory* filesystem_factory
 * 
 *     def __init__(self, FileSystem filesystem not None, paths_or_selector,             # <<<<<<<<<<<<<<
 *                  FileFormat format not None,
 *                  FileSystemFactoryOptions options=None):
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, PyObject *__pyx_v_paths_or_selector, struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_format, struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *__pyx_v_options) {
  std::vector<std::string>  __pyx_v_paths;
  std::vector<arrow::fs::FileInfo>  __pyx_v_finfos;
  arrow::fs::FileSelector __pyx_v_c_selector;
  arrow::Result<std::shared_ptr<arrow::dataset::DatasetFactory> >  __pyx_v_result;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_v_c_filesystem;
  std::shared_ptr<arrow::dataset::FileFormat>  __pyx_v_c_format;
  arrow::dataset::FileSystemFactoryOptions __pyx_v_c_options;
  PyObject *__pyx_9genexpr10__pyx_v_s = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  arrow::dataset::FileSystemFactoryOptions __pyx_t_6;
  std::shared_ptr<arrow::fs::FileSystem>  __pyx_t_7;
  std::shared_ptr<arrow::dataset::FileFormat>  __pyx_t_8;
  arrow::fs::FileSelector __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  std::vector<arrow::fs::FileInfo>  __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  std::vector<std::string>  __pyx_t_16;
  std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_options);

  /* "pyarrow/_dataset.pyx":3381
 *             CFileSystemFactoryOptions c_options
 * 
 *         options = options or FileSystemFactoryOptions()             # <<<<<<<<<<<<<<
 *         c_options = options.unwrap()
 *         c_filesystem = filesystem.unwrap()
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_options)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3381, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_options);
    __pyx_t_1 = ((PyObject *)__pyx_v_options);
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3381, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_options, ((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3382
 * 
 *         options = options or FileSystemFactoryOptions()
 *         c_options = options.unwrap()             # <<<<<<<<<<<<<<
 *         c_filesystem = filesystem.unwrap()
 *         c_format = format.unwrap()
*/
  __pyx_t_6 = __pyx_f_7pyarrow_8_dataset_24FileSystemFactoryOptions_unwrap(__pyx_v_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3382, __pyx_L1_error)
  __pyx_v_c_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":3383
 *         options = options or FileSystemFactoryOptions()
 *         c_options = options.unwrap()
 *         c_filesystem = filesystem.unwrap()             # <<<<<<<<<<<<<<
 *         c_format = format.unwrap()
 * 
*/
  __pyx_t_7 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem->__pyx_vtab)->unwrap(__pyx_v_filesystem); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3383, __pyx_L1_error)
  __pyx_v_c_filesystem = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":3384
 *         c_options = options.unwrap()
 *         c_filesystem = filesystem.unwrap()
 *         c_format = format.unwrap()             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(paths_or_selector, FileSelector):
*/
  __pyx_t_8 = __pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap(__pyx_v_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3384, __pyx_L1_error)
  __pyx_v_c_format = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":3386
 *         c_format = format.unwrap()
 * 
 *         if isinstance(paths_or_selector, FileSelector):             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 c_selector = (<FileSelector> paths_or_selector).selector
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_paths_or_selector, __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSelector); 
  if (__pyx_t_2) {

    /* "pyarrow/_dataset.pyx":3387
 * 
 *         if isinstance(paths_or_selector, FileSelector):
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 c_selector = (<FileSelector> paths_or_selector).selector
 *                 result = CFileSystemDatasetFactory.MakeFromSelector(
*/
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_dataset.pyx":3388
 *         if isinstance(paths_or_selector, FileSelector):
 *             with nogil:
 *                 c_selector = (<FileSelector> paths_or_selector).selector             # <<<<<<<<<<<<<<
 *                 result = CFileSystemDatasetFactory.MakeFromSelector(
 *                     c_filesystem,
*/
          __pyx_t_9 = ((struct __pyx_obj_7pyarrow_3_fs_FileSelector *)__pyx_v_paths_or_selector)->selector;
          __pyx_v_c_selector = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

          /* "pyarrow/_dataset.pyx":3389
 *             with nogil:
 *                 c_selector = (<FileSelector> paths_or_selector).selector
 *                 result = CFileSystemDatasetFactory.MakeFromSelector(             # <<<<<<<<<<<<<<
 *                     c_filesystem,
 *                     c_selector,
*/
          __pyx_v_result = arrow::dataset::FileSystemDatasetFactory::Make(__pyx_v_c_filesystem, __pyx_v_c_selector, __pyx_v_c_format, __pyx_v_c_options);
        }

        /* "pyarrow/_dataset.pyx":3387
 * 
 *         if isinstance(paths_or_selector, FileSelector):
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 c_selector = (<FileSelector> paths_or_selector).selector
 *                 result = CFileSystemDatasetFactory.MakeFromSelector(
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L8;
          }
          __pyx_L8:;
        }
    }

    /* "pyarrow/_dataset.pyx":3386
 *         c_format = format.unwrap()
 * 
 *         if isinstance(paths_or_selector, FileSelector):             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 c_selector = (<FileSelector> paths_or_selector).selector
*/
    goto __pyx_L5;
  }

  /* "pyarrow/_dataset.pyx":3395
 *                     c_options
 *                 )
 *         elif isinstance(paths_or_selector, (list, tuple)):             # <<<<<<<<<<<<<<
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):
 *                 finfos = unwrap_finfos(paths_or_selector)
*/
  __pyx_t_10 = PyList_Check(__pyx_v_paths_or_selector); 
  if (!__pyx_t_10) {
  } else {
    __pyx_t_2 = __pyx_t_10;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_10 = PyTuple_Check(__pyx_v_paths_or_selector); 
  __pyx_t_2 = __pyx_t_10;
  __pyx_L9_bool_binop_done:;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":3396
 *                 )
 *         elif isinstance(paths_or_selector, (list, tuple)):
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):             # <<<<<<<<<<<<<<
 *                 finfos = unwrap_finfos(paths_or_selector)
 *                 with nogil:
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_paths_or_selector); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3396, __pyx_L1_error)
    __pyx_t_10 = (__pyx_t_11 > 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_2 = __pyx_t_10;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_paths_or_selector, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_TypeCheck(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileInfo); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __pyx_t_10;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyarrow/_dataset.pyx":3397
 *         elif isinstance(paths_or_selector, (list, tuple)):
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):
 *                 finfos = unwrap_finfos(paths_or_selector)             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     result = CFileSystemDatasetFactory.MakeFromFileInfos(
*/
      __pyx_t_12 = __pyx_f_7pyarrow_8_dataset_unwrap_finfos(__pyx_v_paths_or_selector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3397, __pyx_L1_error)
      __pyx_v_finfos = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12);

      /* "pyarrow/_dataset.pyx":3398
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):
 *                 finfos = unwrap_finfos(paths_or_selector)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     result = CFileSystemDatasetFactory.MakeFromFileInfos(
 *                         c_filesystem,
*/
      {
          PyThreadState * _save;
          _save = PyEval_SaveThread();
          __Pyx_FastGIL_Remember();
          /*try:*/ {

            /* "pyarrow/_dataset.pyx":3399
 *                 finfos = unwrap_finfos(paths_or_selector)
 *                 with nogil:
 *                     result = CFileSystemDatasetFactory.MakeFromFileInfos(             # <<<<<<<<<<<<<<
 *                         c_filesystem,
 *                         finfos,
*/
            __pyx_v_result = arrow::dataset::FileSystemDatasetFactory::Make(__pyx_v_c_filesystem, __pyx_v_finfos, __pyx_v_c_format, __pyx_v_c_options);
          }

          /* "pyarrow/_dataset.pyx":3398
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):
 *                 finfos = unwrap_finfos(paths_or_selector)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     result = CFileSystemDatasetFactory.MakeFromFileInfos(
 *                         c_filesystem,
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_FastGIL_Forget();
              PyEval_RestoreThread(_save);
              goto __pyx_L16;
            }
            __pyx_L16:;
          }
      }

      /* "pyarrow/_dataset.pyx":3396
 *                 )
 *         elif isinstance(paths_or_selector, (list, tuple)):
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):             # <<<<<<<<<<<<<<
 *                 finfos = unwrap_finfos(paths_or_selector)
 *                 with nogil:
*/
      goto __pyx_L11;
    }

    /* "pyarrow/_dataset.pyx":3406
 *                     )
 *             else:
 *                 paths = [tobytes(s) for s in paths_or_selector]             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     result = CFileSystemDatasetFactory.MakeFromPaths(
*/
    /*else*/ {
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3406, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (likely(PyList_CheckExact(__pyx_v_paths_or_selector)) || PyTuple_CheckExact(__pyx_v_paths_or_selector)) {
          __pyx_t_3 = __pyx_v_paths_or_selector; __Pyx_INCREF(__pyx_t_3);
          __pyx_t_11 = 0;
          __pyx_t_13 = NULL;
        } else {
          __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_paths_or_selector); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3406, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3406, __pyx_L19_error)
        }
        for (;;) {
          if (likely(!__pyx_t_13)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3406, __pyx_L19_error)
                #endif
                if (__pyx_t_11 >= __pyx_temp) break;
              }
              __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_11;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3406, __pyx_L19_error)
                #endif
                if (__pyx_t_11 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11));
              #else
              __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11);
              #endif
              ++__pyx_t_11;
            }
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3406, __pyx_L19_error)
          } else {
            __pyx_t_4 = __pyx_t_13(__pyx_t_3);
            if (unlikely(!__pyx_t_4)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3406, __pyx_L19_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_s, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_14 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3406, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
            assert(__pyx_t_14);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_9genexpr10__pyx_v_s};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3406, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 3406, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_s); __pyx_9genexpr10__pyx_v_s = 0;
        goto __pyx_L23_exit_scope;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_s); __pyx_9genexpr10__pyx_v_s = 0;
        goto __pyx_L1_error;
        __pyx_L23_exit_scope:;
      } /* exit inner scope */
      __pyx_t_16 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3406, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_paths = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16);

      /* "pyarrow/_dataset.pyx":3407
 *             else:
 *                 paths = [tobytes(s) for s in paths_or_selector]
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     result = CFileSystemDatasetFactory.MakeFromPaths(
 *                         c_filesystem,
*/
      {
          PyThreadState * _save;
          _save = PyEval_SaveThread();
          __Pyx_FastGIL_Remember();
          /*try:*/ {

            /* "pyarrow/_dataset.pyx":3408
 *                 paths = [tobytes(s) for s in paths_or_selector]
 *                 with nogil:
 *                     result = CFileSystemDatasetFactory.MakeFromPaths(             # <<<<<<<<<<<<<<
 *                         c_filesystem,
 *                         paths,
*/
            __pyx_v_result = arrow::dataset::FileSystemDatasetFactory::Make(__pyx_v_c_filesystem, __pyx_v_paths, __pyx_v_c_format, __pyx_v_c_options);
          }

          /* "pyarrow/_dataset.pyx":3407
 *             else:
 *                 paths = [tobytes(s) for s in paths_or_selector]
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     result = CFileSystemDatasetFactory.MakeFromPaths(
 *                         c_filesystem,
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_FastGIL_Forget();
              PyEval_RestoreThread(_save);
              goto __pyx_L26;
            }
            __pyx_L26:;
          }
      }
    }
    __pyx_L11:;

    /* "pyarrow/_dataset.pyx":3395
 *                     c_options
 *                 )
 *         elif isinstance(paths_or_selector, (list, tuple)):             # <<<<<<<<<<<<<<
 *             if len(paths_or_selector) > 0 and isinstance(paths_or_selector[0], FileInfo):
 *                 finfos = unwrap_finfos(paths_or_selector)
*/
    goto __pyx_L5;
  }

  /* "pyarrow/_dataset.pyx":3415
 *                     )
 *         else:
 *             raise TypeError('Must pass either paths or a FileSelector, but '             # <<<<<<<<<<<<<<
 *                             f'passed {type(paths_or_selector)}')
 * 
*/
  /*else*/ {
    __pyx_t_3 = NULL;

    /* "pyarrow/_dataset.pyx":3416
 *         else:
 *             raise TypeError('Must pass either paths or a FileSelector, but '
 *                             f'passed {type(paths_or_selector)}')             # <<<<<<<<<<<<<<
 * 
 *         self.init(GetResultValue(result))
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_paths_or_selector)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "pyarrow/_dataset.pyx":3415
 *                     )
 *         else:
 *             raise TypeError('Must pass either paths or a FileSelector, but '             # <<<<<<<<<<<<<<
 *                             f'passed {type(paths_or_selector)}')
 * 
*/
    __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Must_pass_either_paths_or_a_File, __pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 3415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_15};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3415, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3415, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "pyarrow/_dataset.pyx":3418
 *                             f'passed {type(paths_or_selector)}')
 * 
 *         self.init(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, shared_ptr[CDatasetFactory]& sp):
*/
  __pyx_t_17 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::DatasetFactory> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3418, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDatasetFactory *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3369
 *         CFileSystemDatasetFactory* filesystem_factory
 * 
 *     def __init__(self, FileSystem filesystem not None, paths_or_selector,             # <<<<<<<<<<<<<<
 *                  FileFormat format not None,
 *                  FileSystemFactoryOptions options=None):
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDatasetFactory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_s);
  __Pyx_XDECREF((PyObject *)__pyx_v_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3420
 *         self.init(GetResultValue(result))
 * 
 *     cdef init(self, shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         DatasetFactory.init(self, sp)
 *         self.filesystem_factory = <CFileSystemDatasetFactory*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_24FileSystemDatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":3421
 * 
 *     cdef init(self, shared_ptr[CDatasetFactory]& sp):
 *         DatasetFactory.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.filesystem_factory = <CFileSystemDatasetFactory*> sp.get()
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_14DatasetFactory_init(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3422
 *     cdef init(self, shared_ptr[CDatasetFactory]& sp):
 *         DatasetFactory.init(self, sp)
 *         self.filesystem_factory = <CFileSystemDatasetFactory*> sp.get()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->filesystem_factory = ((arrow::dataset::FileSystemDatasetFactory *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":3420
 *         self.init(GetResultValue(result))
 * 
 *     cdef init(self, shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         DatasetFactory.init(self, sp)
 *         self.filesystem_factory = <CFileSystemDatasetFactory*> sp.get()
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__, "FileSystemDatasetFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_filesystem_fac, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDatasetFactory.__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.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__, "FileSystemDatasetFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.FileSystemDatasetFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_filesystem_fac, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3438
 *         CUnionDatasetFactory* union_factory
 * 
 *     def __init__(self, list factories):             # <<<<<<<<<<<<<<
 *         cdef:
 *             DatasetFactory factory
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_factories = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_factories,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3438, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3438, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 3438, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 3438, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3438, __pyx_L3_error)
    }
    __pyx_v_factories = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3438, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.UnionDatasetFactory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_factories), (&PyList_Type), 1, "factories", 1))) __PYX_ERR(0, 3438, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory___init__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *)__pyx_v_self), __pyx_v_factories);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory___init__(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, PyObject *__pyx_v_factories) {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *__pyx_v_factory = 0;
  std::vector<std::shared_ptr<arrow::dataset::DatasetFactory> >  __pyx_v_c_factories;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  std::shared_ptr<arrow::dataset::DatasetFactory>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3442
 *             DatasetFactory factory
 *             vector[shared_ptr[CDatasetFactory]] c_factories
 *         for factory in factories:             # <<<<<<<<<<<<<<
 *             c_factories.push_back(factory.unwrap())
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))
*/
  if (unlikely(__pyx_v_factories == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 3442, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_factories; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3442, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory))))) __PYX_ERR(0, 3442, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_factory, ((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":3443
 *             vector[shared_ptr[CDatasetFactory]] c_factories
 *         for factory in factories:
 *             c_factories.push_back(factory.unwrap())             # <<<<<<<<<<<<<<
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))
 * 
*/
    __pyx_t_4 = __pyx_f_7pyarrow_8_dataset_14DatasetFactory_unwrap(__pyx_v_factory); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3443, __pyx_L1_error)
    try {
      __pyx_v_c_factories.push_back(__pyx_t_4);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3443, __pyx_L1_error)
    }

    /* "pyarrow/_dataset.pyx":3442
 *             DatasetFactory factory
 *             vector[shared_ptr[CDatasetFactory]] c_factories
 *         for factory in factories:             # <<<<<<<<<<<<<<
 *             c_factories.push_back(factory.unwrap())
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3444
 *         for factory in factories:
 *             c_factories.push_back(factory.unwrap())
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
*/
  __pyx_t_4 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::DatasetFactory> >(arrow::dataset::UnionDatasetFactory::Make(__pyx_v_c_factories)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3444, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDatasetFactory *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3438
 *         CUnionDatasetFactory* union_factory
 * 
 *     def __init__(self, list factories):             # <<<<<<<<<<<<<<
 *         cdef:
 *             DatasetFactory factory
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.UnionDatasetFactory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_factory);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3446
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         DatasetFactory.init(self, sp)
 *         self.union_factory = <CUnionDatasetFactory*> sp.get()
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_19UnionDatasetFactory_init(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, std::shared_ptr<arrow::dataset::DatasetFactory>  const &__pyx_v_sp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_dataset.pyx":3447
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
 *         DatasetFactory.init(self, sp)             # <<<<<<<<<<<<<<
 *         self.union_factory = <CUnionDatasetFactory*> sp.get()
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_14DatasetFactory_init(((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)__pyx_v_self), __pyx_v_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3448
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):
 *         DatasetFactory.init(self, sp)
 *         self.union_factory = <CUnionDatasetFactory*> sp.get()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_self->union_factory = ((arrow::dataset::UnionDatasetFactory *)__pyx_v_sp.get());

  /* "pyarrow/_dataset.pyx":3446
 *         self.init(GetResultValue(CUnionDatasetFactory.Make(c_factories)))
 * 
 *     cdef init(self, const shared_ptr[CDatasetFactory]& sp):             # <<<<<<<<<<<<<<
 *         DatasetFactory.init(self, sp)
 *         self.union_factory = <CUnionDatasetFactory*> sp.get()
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__, "UnionDatasetFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_union_factory, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.UnionDatasetFactory.__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.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__, "UnionDatasetFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.UnionDatasetFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_factory_self_union_factory, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3460
 *         SharedPtrNoGIL[CRecordBatchIterator] iterator
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator___init__(((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator___init__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3461
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_subclasses_instead, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 3461, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3460
 *         SharedPtrNoGIL[CRecordBatchIterator] iterator
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.RecordBatchIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3463
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(object owner, CRecordBatchIterator iterator):
 *         cdef RecordBatchIterator self = \
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_wrap(PyObject *__pyx_v_owner, arrow::RecordBatchIterator __pyx_v_iterator) {
  struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::RecordBatchIterator>  __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":3466
 *     cdef wrap(object owner, CRecordBatchIterator iterator):
 *         cdef RecordBatchIterator self = \
 *             RecordBatchIterator.__new__(RecordBatchIterator)             # <<<<<<<<<<<<<<
 *         self.iterator_owner = owner
 *         self.iterator = make_shared[CRecordBatchIterator](move(iterator))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_8_dataset_RecordBatchIterator(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3466, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3467
 *         cdef RecordBatchIterator self = \
 *             RecordBatchIterator.__new__(RecordBatchIterator)
 *         self.iterator_owner = owner             # <<<<<<<<<<<<<<
 *         self.iterator = make_shared[CRecordBatchIterator](move(iterator))
 *         return self
*/
  __Pyx_INCREF(__pyx_v_owner);
  __Pyx_GIVEREF(__pyx_v_owner);
  __Pyx_GOTREF(__pyx_v_self->iterator_owner);
  __Pyx_DECREF(__pyx_v_self->iterator_owner);
  __pyx_v_self->iterator_owner = __pyx_v_owner;

  /* "pyarrow/_dataset.pyx":3468
 *             RecordBatchIterator.__new__(RecordBatchIterator)
 *         self.iterator_owner = owner
 *         self.iterator = make_shared[CRecordBatchIterator](move(iterator))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  try {
    __pyx_t_2 = std::make_shared<arrow::RecordBatchIterator>(cython_std::move<arrow::RecordBatchIterator>(__pyx_v_iterator));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3468, __pyx_L1_error)
  }
  __pyx_v_self->iterator = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::py::SharedPtrNoGIL<arrow::RecordBatchIterator> )__pyx_t_2));

  /* "pyarrow/_dataset.pyx":3469
 *         self.iterator_owner = owner
 *         self.iterator = make_shared[CRecordBatchIterator](move(iterator))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CRecordBatchIterator] unwrap(self) nogil:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3463
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(object owner, CRecordBatchIterator iterator):
 *         cdef RecordBatchIterator self = \
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.RecordBatchIterator.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3471
 *         return self
 * 
 *     cdef inline shared_ptr[CRecordBatchIterator] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.iterator
 * 
*/

static CYTHON_INLINE std::shared_ptr<arrow::RecordBatchIterator>  __pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_unwrap(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self) {
  std::shared_ptr<arrow::RecordBatchIterator>  __pyx_r;

  /* "pyarrow/_dataset.pyx":3472
 * 
 *     cdef inline shared_ptr[CRecordBatchIterator] unwrap(self) nogil:
 *         return self.iterator             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
*/
  __pyx_r = __pyx_v_self->iterator;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3471
 *         return self
 * 
 *     cdef inline shared_ptr[CRecordBatchIterator] unwrap(self) nogil:             # <<<<<<<<<<<<<<
 *         return self.iterator
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3474
 *         return self.iterator
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_2__iter__(((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_2__iter__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pyarrow/_dataset.pyx":3475
 * 
 *     def __iter__(self):
 *         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/_dataset.pyx":3474
 *         return self.iterator
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "pyarrow/_dataset.pyx":3477
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] record_batch
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_4__next__(((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_4__next__(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_record_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  std::shared_ptr< arrow::RecordBatch>  __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pyarrow/_dataset.pyx":3479
 *     def __next__(self):
 *         cdef shared_ptr[CRecordBatch] record_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))
 *         if record_batch == NULL:
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3480
 *         cdef shared_ptr[CRecordBatch] record_batch
 *         with nogil:
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))             # <<<<<<<<<<<<<<
 *         if record_batch == NULL:
 *             raise StopIteration
*/
        __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::RecordBatch> >(cython_std::move<arrow::Result<std::shared_ptr< arrow::RecordBatch> > >(__pyx_v_self->iterator.get()->Next())); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3480, __pyx_L4_error)
        __pyx_v_record_batch = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);
      }

      /* "pyarrow/_dataset.pyx":3479
 *     def __next__(self):
 *         cdef shared_ptr[CRecordBatch] record_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))
 *         if record_batch == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":3481
 *         with nogil:
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))
 *         if record_batch == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return pyarrow_wrap_batch(record_batch)
*/
  __pyx_t_2 = ((__pyx_v_record_batch == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":3482
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))
 *         if record_batch == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_batch(record_batch)
 * 
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "pyarrow/_dataset.pyx":3481
 *         with nogil:
 *             record_batch = GetResultValue(move(self.iterator.get().Next()))
 *         if record_batch == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return pyarrow_wrap_batch(record_batch)
*/
  }

  /* "pyarrow/_dataset.pyx":3483
 *         if record_batch == NULL:
 *             raise StopIteration
 *         return pyarrow_wrap_batch(record_batch)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_record_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3477
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CRecordBatch] record_batch
 *         with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("pyarrow._dataset.RecordBatchIterator.__next__", __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.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__, "RecordBatchIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_iterator_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.RecordBatchIterator.__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.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__, "RecordBatchIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.RecordBatchIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_iterator_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3506
 *         SharedPtrNoGIL[CTaggedRecordBatchIterator] iterator
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator___init__(((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator___init__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3507
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_subclasses_instead, Py_False, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 3507, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3506
 *         SharedPtrNoGIL[CTaggedRecordBatchIterator] iterator
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._dataset.TaggedRecordBatchIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3509
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(object owner, CTaggedRecordBatchIterator iterator):
 *         cdef TaggedRecordBatchIterator self = \
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_25TaggedRecordBatchIterator_wrap(PyObject *__pyx_v_owner, arrow::dataset::TaggedRecordBatchIterator __pyx_v_iterator) {
  struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr<arrow::dataset::TaggedRecordBatchIterator>  __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":3512
 *     cdef wrap(object owner, CTaggedRecordBatchIterator iterator):
 *         cdef TaggedRecordBatchIterator self = \
 *             TaggedRecordBatchIterator.__new__(TaggedRecordBatchIterator)             # <<<<<<<<<<<<<<
 *         self.iterator_owner = owner
 *         self.iterator = make_shared[CTaggedRecordBatchIterator](
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_8_dataset_TaggedRecordBatchIterator(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3513
 *         cdef TaggedRecordBatchIterator self = \
 *             TaggedRecordBatchIterator.__new__(TaggedRecordBatchIterator)
 *         self.iterator_owner = owner             # <<<<<<<<<<<<<<
 *         self.iterator = make_shared[CTaggedRecordBatchIterator](
 *             move(iterator))
*/
  __Pyx_INCREF(__pyx_v_owner);
  __Pyx_GIVEREF(__pyx_v_owner);
  __Pyx_GOTREF(__pyx_v_self->iterator_owner);
  __Pyx_DECREF(__pyx_v_self->iterator_owner);
  __pyx_v_self->iterator_owner = __pyx_v_owner;

  /* "pyarrow/_dataset.pyx":3514
 *             TaggedRecordBatchIterator.__new__(TaggedRecordBatchIterator)
 *         self.iterator_owner = owner
 *         self.iterator = make_shared[CTaggedRecordBatchIterator](             # <<<<<<<<<<<<<<
 *             move(iterator))
 *         return self
*/
  try {
    __pyx_t_2 = std::make_shared<arrow::dataset::TaggedRecordBatchIterator>(cython_std::move<arrow::dataset::TaggedRecordBatchIterator>(__pyx_v_iterator));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3514, __pyx_L1_error)
  }
  __pyx_v_self->iterator = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::py::SharedPtrNoGIL<arrow::dataset::TaggedRecordBatchIterator> )__pyx_t_2));

  /* "pyarrow/_dataset.pyx":3516
 *         self.iterator = make_shared[CTaggedRecordBatchIterator](
 *             move(iterator))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3509
 *         _forbid_instantiation(self.__class__, subclasses_instead=False)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(object owner, CTaggedRecordBatchIterator iterator):
 *         cdef TaggedRecordBatchIterator self = \
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.TaggedRecordBatchIterator.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3518
 *         return self
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_3__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_2__iter__(((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_2__iter__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pyarrow/_dataset.pyx":3519
 * 
 *     def __iter__(self):
 *         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/_dataset.pyx":3518
 *         return self
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "pyarrow/_dataset.pyx":3521
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef CTaggedRecordBatch batch
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_4__next__(((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_4__next__(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self) {
  arrow::dataset::TaggedRecordBatch __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  arrow::dataset::TaggedRecordBatch __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pyarrow/_dataset.pyx":3523
 *     def __next__(self):
 *         cdef CTaggedRecordBatch batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             batch = GetResultValue(move(self.iterator.get().Next()))
 *         if batch.record_batch == NULL:
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3524
 *         cdef CTaggedRecordBatch batch
 *         with nogil:
 *             batch = GetResultValue(move(self.iterator.get().Next()))             # <<<<<<<<<<<<<<
 *         if batch.record_batch == NULL:
 *             raise StopIteration
*/
        __pyx_t_1 = arrow::py::GetResultValue<arrow::dataset::TaggedRecordBatch>(cython_std::move<arrow::Result<arrow::dataset::TaggedRecordBatch> >(__pyx_v_self->iterator.get()->Next())); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3524, __pyx_L4_error)
        __pyx_v_batch = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);
      }

      /* "pyarrow/_dataset.pyx":3523
 *     def __next__(self):
 *         cdef CTaggedRecordBatch batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             batch = GetResultValue(move(self.iterator.get().Next()))
 *         if batch.record_batch == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":3525
 *         with nogil:
 *             batch = GetResultValue(move(self.iterator.get().Next()))
 *         if batch.record_batch == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return TaggedRecordBatch(
*/
  __pyx_t_2 = ((__pyx_v_batch.record_batch == NULL) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_dataset.pyx":3526
 *             batch = GetResultValue(move(self.iterator.get().Next()))
 *         if batch.record_batch == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return TaggedRecordBatch(
 *             record_batch=pyarrow_wrap_batch(batch.record_batch),
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "pyarrow/_dataset.pyx":3525
 *         with nogil:
 *             batch = GetResultValue(move(self.iterator.get().Next()))
 *         if batch.record_batch == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return TaggedRecordBatch(
*/
  }

  /* "pyarrow/_dataset.pyx":3527
 *         if batch.record_batch == NULL:
 *             raise StopIteration
 *         return TaggedRecordBatch(             # <<<<<<<<<<<<<<
 *             record_batch=pyarrow_wrap_batch(batch.record_batch),
 *             fragment=Fragment.wrap(batch.fragment))
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":3528
 *             raise StopIteration
 *         return TaggedRecordBatch(
 *             record_batch=pyarrow_wrap_batch(batch.record_batch),             # <<<<<<<<<<<<<<
 *             fragment=Fragment.wrap(batch.fragment))
 * 
*/
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_batch.record_batch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":3529
 *         return TaggedRecordBatch(
 *             record_batch=pyarrow_wrap_batch(batch.record_batch),
 *             fragment=Fragment.wrap(batch.fragment))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = __pyx_f_7pyarrow_8_dataset_8Fragment_wrap(__pyx_v_batch.fragment); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_record_batch, __pyx_t_6, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 3527, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_fragment, __pyx_t_7, __pyx_t_9, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3521
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef CTaggedRecordBatch batch
 *         with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("pyarrow._dataset.TaggedRecordBatchIterator.__next__", __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.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__, "TaggedRecordBatchIterator.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_iterator_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.TaggedRecordBatchIterator.__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.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__, "TaggedRecordBatchIterator.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.TaggedRecordBatchIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_iterator_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":3532
 * 
 * 
 * cdef void _populate_builder(const shared_ptr[CScannerBuilder]& ptr,             # <<<<<<<<<<<<<<
 *                             object columns=None, Expression filter=None,
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
*/

static void __pyx_f_7pyarrow_8_dataset__populate_builder(std::shared_ptr<arrow::dataset::ScannerBuilder>  const &__pyx_v_ptr, struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder *__pyx_optional_args) {

  /* "pyarrow/_dataset.pyx":3533
 * 
 * cdef void _populate_builder(const shared_ptr[CScannerBuilder]& ptr,
 *                             object columns=None, Expression filter=None,             # <<<<<<<<<<<<<<
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
 *                             int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
  PyObject *__pyx_v_columns = ((PyObject *)Py_None);
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None);
  int __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__44;
  int __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__45;
  int __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__46;

  /* "pyarrow/_dataset.pyx":3537
 *                             int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                             int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                             bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                             MemoryPool memory_pool=None,
 *                             FragmentScanOptions fragment_scan_options=None)\
*/
  int __pyx_v_use_threads = ((int)1);
  int __pyx_v_cache_metadata = ((int)1);

  /* "pyarrow/_dataset.pyx":3538
 *                             int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                             bint use_threads=True, bint cache_metadata=True,
 *                             MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                             FragmentScanOptions fragment_scan_options=None)\
 *         except *:
*/
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None);

  /* "pyarrow/_dataset.pyx":3539
 *                             bint use_threads=True, bint cache_metadata=True,
 *                             MemoryPool memory_pool=None,
 *                             FragmentScanOptions fragment_scan_options=None)\             # <<<<<<<<<<<<<<
 *         except *:
 *     cdef:
*/
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None);
  arrow::dataset::ScannerBuilder *__pyx_v_builder;
  std::vector<arrow::compute::Expression>  __pyx_v_c_exprs;
  PyObject *__pyx_v_expr = NULL;
  PyObject *__pyx_9genexpr11__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr12__pyx_v_c = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  arrow::compute::Expression __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12[3];
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  std::vector<std::string>  __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
   arrow::MemoryPool *__pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_populate_builder", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_columns = __pyx_optional_args->columns;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_filter = __pyx_optional_args->filter;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_batch_size = __pyx_optional_args->batch_size;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_batch_readahead = __pyx_optional_args->batch_readahead;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_fragment_readahead = __pyx_optional_args->fragment_readahead;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_use_threads = __pyx_optional_args->use_threads;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_cache_metadata = __pyx_optional_args->cache_metadata;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_memory_pool = __pyx_optional_args->memory_pool;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_fragment_scan_options = __pyx_optional_args->fragment_scan_options;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  __Pyx_INCREF(__pyx_v_columns);

  /* "pyarrow/_dataset.pyx":3545
 *         vector[CExpression] c_exprs
 * 
 *     builder = ptr.get()             # <<<<<<<<<<<<<<
 * 
 *     check_status(builder.Filter(_bind(
*/
  __pyx_v_builder = __pyx_v_ptr.get();

  /* "pyarrow/_dataset.pyx":3548
 * 
 *     check_status(builder.Filter(_bind(
 *         filter, pyarrow_wrap_schema(builder.schema()))))             # <<<<<<<<<<<<<<
 * 
 *     if columns is not None:
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_builder->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(0, 3548, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3547
 *     builder = ptr.get()
 * 
 *     check_status(builder.Filter(_bind(             # <<<<<<<<<<<<<<
 *         filter, pyarrow_wrap_schema(builder.schema()))))
 * 
*/
  __pyx_t_2 = __pyx_f_7pyarrow_8_compute__bind(__pyx_v_filter, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->Filter(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3547, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3550
 *         filter, pyarrow_wrap_schema(builder.schema()))))
 * 
 *     if columns is not None:             # <<<<<<<<<<<<<<
 *         if pa_substrait and isinstance(columns, pa_substrait.BoundExpressions):
 *             columns = columns.expressions
*/
  __pyx_t_4 = (__pyx_v_columns != Py_None);
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":3551
 * 
 *     if columns is not None:
 *         if pa_substrait and isinstance(columns, pa_substrait.BoundExpressions):             # <<<<<<<<<<<<<<
 *             columns = columns.expressions
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa_substrait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 3551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L5_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa_substrait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_BoundExpressions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = PyObject_IsInstance(__pyx_v_columns, __pyx_t_6); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 3551, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_4) {

      /* "pyarrow/_dataset.pyx":3552
 *     if columns is not None:
 *         if pa_substrait and isinstance(columns, pa_substrait.BoundExpressions):
 *             columns = columns.expressions             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(columns, dict):
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_columns, __pyx_mstate_global->__pyx_n_u_expressions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3552, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_columns, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pyarrow/_dataset.pyx":3551
 * 
 *     if columns is not None:
 *         if pa_substrait and isinstance(columns, pa_substrait.BoundExpressions):             # <<<<<<<<<<<<<<
 *             columns = columns.expressions
 * 
*/
    }

    /* "pyarrow/_dataset.pyx":3554
 *             columns = columns.expressions
 * 
 *         if isinstance(columns, dict):             # <<<<<<<<<<<<<<
 *             for expr in columns.values():
 *                 if not isinstance(expr, Expression):
*/
    __pyx_t_4 = PyDict_Check(__pyx_v_columns); 
    if (__pyx_t_4) {

      /* "pyarrow/_dataset.pyx":3555
 * 
 *         if isinstance(columns, dict):
 *             for expr in columns.values():             # <<<<<<<<<<<<<<
 *                 if not isinstance(expr, Expression):
 *                     raise TypeError(
*/
      __pyx_t_7 = 0;
      if (unlikely(__pyx_v_columns == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
        __PYX_ERR(0, 3555, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_columns, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_8), (&__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6);
      __pyx_t_6 = __pyx_t_1;
      __pyx_t_1 = 0;
      while (1) {
        __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, NULL, &__pyx_t_1, NULL, __pyx_t_3);
        if (unlikely(__pyx_t_9 == 0)) break;
        if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_expr, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "pyarrow/_dataset.pyx":3556
 *         if isinstance(columns, dict):
 *             for expr in columns.values():
 *                 if not isinstance(expr, Expression):             # <<<<<<<<<<<<<<
 *                     raise TypeError(
 *                         "Expected an Expression for a 'column' dictionary "
*/
        __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_expr, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression); 
        __pyx_t_5 = (!__pyx_t_4);
        if (unlikely(__pyx_t_5)) {

          /* "pyarrow/_dataset.pyx":3557
 *             for expr in columns.values():
 *                 if not isinstance(expr, Expression):
 *                     raise TypeError(             # <<<<<<<<<<<<<<
 *                         "Expected an Expression for a 'column' dictionary "
 *                         f"value, got {type(expr)} instead"
*/
          __pyx_t_10 = NULL;

          /* "pyarrow/_dataset.pyx":3559
 *                     raise TypeError(
 *                         "Expected an Expression for a 'column' dictionary "
 *                         f"value, got {type(expr)} instead"             # <<<<<<<<<<<<<<
 *                     )
 *                 c_exprs.push_back((<Expression> expr).unwrap())
*/
          __pyx_t_11 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_expr)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Expected_an_Expression_for_a_col;
          __pyx_t_12[1] = __pyx_t_11;
          __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_instead;

          /* "pyarrow/_dataset.pyx":3558
 *                 if not isinstance(expr, Expression):
 *                     raise TypeError(
 *                         "Expected an Expression for a 'column' dictionary "             # <<<<<<<<<<<<<<
 *                         f"value, got {type(expr)} instead"
 *                     )
*/
          __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, 60 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3558, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_14 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_13};
            __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3557, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 3557, __pyx_L1_error)

          /* "pyarrow/_dataset.pyx":3556
 *         if isinstance(columns, dict):
 *             for expr in columns.values():
 *                 if not isinstance(expr, Expression):             # <<<<<<<<<<<<<<
 *                     raise TypeError(
 *                         "Expected an Expression for a 'column' dictionary "
*/
        }

        /* "pyarrow/_dataset.pyx":3561
 *                         f"value, got {type(expr)} instead"
 *                     )
 *                 c_exprs.push_back((<Expression> expr).unwrap())             # <<<<<<<<<<<<<<
 * 
 *             check_status(
*/
        __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_expr)->__pyx_vtab)->unwrap(((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_v_expr)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3561, __pyx_L1_error)
        try {
          __pyx_v_c_exprs.push_back(__pyx_t_2);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 3561, __pyx_L1_error)
        }
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/_dataset.pyx":3564
 * 
 *             check_status(
 *                 builder.Project(c_exprs, [tobytes(c) for c in columns.keys()])             # <<<<<<<<<<<<<<
 *             )
 *         elif isinstance(columns, list):
*/
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3564, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = 0;
        if (unlikely(__pyx_v_columns == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
          __PYX_ERR(0, 3564, __pyx_L13_error)
        }
        __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_columns, 0, __pyx_mstate_global->__pyx_n_u_keys, (&__pyx_t_7), (&__pyx_t_3)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3564, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_XDECREF(__pyx_t_1);
        __pyx_t_1 = __pyx_t_13;
        __pyx_t_13 = 0;
        while (1) {
          __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_8, &__pyx_t_13, NULL, NULL, __pyx_t_3);
          if (unlikely(__pyx_t_9 == 0)) break;
          if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 3564, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_c, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3564, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_14 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_14 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr11__pyx_v_c};
            __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3564, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_13);
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 3564, __pyx_L13_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c); __pyx_9genexpr11__pyx_v_c = 0;
        goto __pyx_L16_exit_scope;
        __pyx_L13_error:;
        __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c); __pyx_9genexpr11__pyx_v_c = 0;
        goto __pyx_L1_error;
        __pyx_L16_exit_scope:;
      } /* exit inner scope */
      __pyx_t_15 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3564, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "pyarrow/_dataset.pyx":3563
 *                 c_exprs.push_back((<Expression> expr).unwrap())
 * 
 *             check_status(             # <<<<<<<<<<<<<<
 *                 builder.Project(c_exprs, [tobytes(c) for c in columns.keys()])
 *             )
*/
      __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->Project(__pyx_v_c_exprs, __pyx_t_15)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3563, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":3554
 *             columns = columns.expressions
 * 
 *         if isinstance(columns, dict):             # <<<<<<<<<<<<<<
 *             for expr in columns.values():
 *                 if not isinstance(expr, Expression):
*/
      goto __pyx_L7;
    }

    /* "pyarrow/_dataset.pyx":3566
 *                 builder.Project(c_exprs, [tobytes(c) for c in columns.keys()])
 *             )
 *         elif isinstance(columns, list):             # <<<<<<<<<<<<<<
 *             check_status(builder.ProjectColumns([tobytes(c) for c in columns]))
 *         else:
*/
    __pyx_t_5 = PyList_Check(__pyx_v_columns); 
    if (likely(__pyx_t_5)) {

      /* "pyarrow/_dataset.pyx":3567
 *             )
 *         elif isinstance(columns, list):
 *             check_status(builder.ProjectColumns([tobytes(c) for c in columns]))             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(
*/
      { /* enter inner scope */
        __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3567, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_6);
        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_7 = 0;
          __pyx_t_16 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3567, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 3567, __pyx_L19_error)
        }
        for (;;) {
          if (likely(!__pyx_t_16)) {
            if (likely(PyList_CheckExact(__pyx_t_1))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3567, __pyx_L19_error)
                #endif
                if (__pyx_t_7 >= __pyx_temp) break;
              }
              __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_7;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3567, __pyx_L19_error)
                #endif
                if (__pyx_t_7 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7));
              #else
              __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7);
              #endif
              ++__pyx_t_7;
            }
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3567, __pyx_L19_error)
          } else {
            __pyx_t_13 = __pyx_t_16(__pyx_t_1);
            if (unlikely(!__pyx_t_13)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3567, __pyx_L19_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_c, __pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3567, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_14 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_10))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
            __pyx_t_14 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_9genexpr12__pyx_v_c};
            __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3567, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_13);
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 3567, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c); __pyx_9genexpr12__pyx_v_c = 0;
        goto __pyx_L23_exit_scope;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c); __pyx_9genexpr12__pyx_v_c = 0;
        goto __pyx_L1_error;
        __pyx_L23_exit_scope:;
      } /* exit inner scope */
      __pyx_t_15 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3567, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->Project(__pyx_t_15)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3567, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":3566
 *                 builder.Project(c_exprs, [tobytes(c) for c in columns.keys()])
 *             )
 *         elif isinstance(columns, list):             # <<<<<<<<<<<<<<
 *             check_status(builder.ProjectColumns([tobytes(c) for c in columns]))
 *         else:
*/
      goto __pyx_L7;
    }

    /* "pyarrow/_dataset.pyx":3569
 *             check_status(builder.ProjectColumns([tobytes(c) for c in columns]))
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Expected a list or a dict for 'columns', "
 *                 f"got {type(columns)} instead."
*/
    /*else*/ {
      __pyx_t_1 = NULL;

      /* "pyarrow/_dataset.pyx":3571
 *             raise ValueError(
 *                 "Expected a list or a dict for 'columns', "
 *                 f"got {type(columns)} instead."             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __pyx_t_13 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_columns)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_list_or_a_dict_for_co;
      __pyx_t_12[1] = __pyx_t_13;
      __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_instead_2;

      /* "pyarrow/_dataset.pyx":3570
 *         else:
 *             raise ValueError(
 *                 "Expected a list or a dict for 'columns', "             # <<<<<<<<<<<<<<
 *                 f"got {type(columns)} instead."
 *             )
*/
      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, 45 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 9, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3569, __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(0, 3569, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "pyarrow/_dataset.pyx":3550
 *         filter, pyarrow_wrap_schema(builder.schema()))))
 * 
 *     if columns is not None:             # <<<<<<<<<<<<<<
 *         if pa_substrait and isinstance(columns, pa_substrait.BoundExpressions):
 *             columns = columns.expressions
*/
  }

  /* "pyarrow/_dataset.pyx":3574
 *             )
 * 
 *     check_status(builder.BatchSize(batch_size))             # <<<<<<<<<<<<<<
 *     check_status(builder.BatchReadahead(batch_readahead))
 *     check_status(builder.FragmentReadahead(fragment_readahead))
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->BatchSize(__pyx_v_batch_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3574, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3575
 * 
 *     check_status(builder.BatchSize(batch_size))
 *     check_status(builder.BatchReadahead(batch_readahead))             # <<<<<<<<<<<<<<
 *     check_status(builder.FragmentReadahead(fragment_readahead))
 *     check_status(builder.UseThreads(use_threads))
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->BatchReadahead(__pyx_v_batch_readahead)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3575, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3576
 *     check_status(builder.BatchSize(batch_size))
 *     check_status(builder.BatchReadahead(batch_readahead))
 *     check_status(builder.FragmentReadahead(fragment_readahead))             # <<<<<<<<<<<<<<
 *     check_status(builder.UseThreads(use_threads))
 *     check_status(builder.CacheMetadata(cache_metadata))
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->FragmentReadahead(__pyx_v_fragment_readahead)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3576, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3577
 *     check_status(builder.BatchReadahead(batch_readahead))
 *     check_status(builder.FragmentReadahead(fragment_readahead))
 *     check_status(builder.UseThreads(use_threads))             # <<<<<<<<<<<<<<
 *     check_status(builder.CacheMetadata(cache_metadata))
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->UseThreads(__pyx_v_use_threads)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3577, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3578
 *     check_status(builder.FragmentReadahead(fragment_readahead))
 *     check_status(builder.UseThreads(use_threads))
 *     check_status(builder.CacheMetadata(cache_metadata))             # <<<<<<<<<<<<<<
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))
 *     if fragment_scan_options:
*/
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->CacheMetadata(__pyx_v_cache_metadata)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3578, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3579
 *     check_status(builder.UseThreads(use_threads))
 *     check_status(builder.CacheMetadata(cache_metadata))
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))             # <<<<<<<<<<<<<<
 *     if fragment_scan_options:
 *         check_status(
*/
  __pyx_t_17 = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3579, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->Pool(__pyx_t_17)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3579, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3580
 *     check_status(builder.CacheMetadata(cache_metadata))
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))
 *     if fragment_scan_options:             # <<<<<<<<<<<<<<
 *         check_status(
 *             builder.FragmentScanOptions(fragment_scan_options.wrapped))
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_fragment_scan_options)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 3580, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pyarrow/_dataset.pyx":3581
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))
 *     if fragment_scan_options:
 *         check_status(             # <<<<<<<<<<<<<<
 *             builder.FragmentScanOptions(fragment_scan_options.wrapped))
 * 
*/
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_builder->FragmentScanOptions(__pyx_v_fragment_scan_options->wrapped)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3581, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3580
 *     check_status(builder.CacheMetadata(cache_metadata))
 *     check_status(builder.Pool(maybe_unbox_memory_pool(memory_pool)))
 *     if fragment_scan_options:             # <<<<<<<<<<<<<<
 *         check_status(
 *             builder.FragmentScanOptions(fragment_scan_options.wrapped))
*/
  }

  /* "pyarrow/_dataset.pyx":3532
 * 
 * 
 * cdef void _populate_builder(const shared_ptr[CScannerBuilder]& ptr,             # <<<<<<<<<<<<<<
 *                             object columns=None, Expression filter=None,
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow._dataset._populate_builder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expr);
  __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/_dataset.pyx":3592
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_7Scanner_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_7Scanner_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner___init__(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_7Scanner___init__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":3593
 * 
 *     def __init__(self):
 *         _forbid_instantiation(self.__class__)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CScanner]& sp):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forbid_instantiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3592
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         _forbid_instantiation(self.__class__)
 * 
*/

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

/* "pyarrow/_dataset.pyx":3595
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CScanner]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.scanner = sp.get()
*/

static void __pyx_f_7pyarrow_8_dataset_7Scanner_init(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, std::shared_ptr<arrow::dataset::Scanner>  const &__pyx_v_sp) {

  /* "pyarrow/_dataset.pyx":3596
 * 
 *     cdef void init(self, const shared_ptr[CScanner]& sp):
 *         self.wrapped = sp             # <<<<<<<<<<<<<<
 *         self.scanner = sp.get()
 * 
*/
  __pyx_v_self->wrapped = ((arrow::py::SharedPtrNoGIL<arrow::dataset::Scanner> )__pyx_v_sp);

  /* "pyarrow/_dataset.pyx":3597
 *     cdef void init(self, const shared_ptr[CScanner]& sp):
 *         self.wrapped = sp
 *         self.scanner = sp.get()             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->scanner = __pyx_v_sp.get();

  /* "pyarrow/_dataset.pyx":3595
 *         _forbid_instantiation(self.__class__)
 * 
 *     cdef void init(self, const shared_ptr[CScanner]& sp):             # <<<<<<<<<<<<<<
 *         self.wrapped = sp
 *         self.scanner = sp.get()
*/

  /* function exit code */
}

/* "pyarrow/_dataset.pyx":3599
 *         self.scanner = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CScanner]& sp):
 *         cdef Scanner self = Scanner.__new__(Scanner)
*/

static PyObject *__pyx_f_7pyarrow_8_dataset_7Scanner_wrap(std::shared_ptr<arrow::dataset::Scanner>  const &__pyx_v_sp) {
  struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_dataset.pyx":3601
 *     @staticmethod
 *     cdef wrap(const shared_ptr[CScanner]& sp):
 *         cdef Scanner self = Scanner.__new__(Scanner)             # <<<<<<<<<<<<<<
 *         self.init(sp)
 *         return self
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_8_dataset_Scanner(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_self = ((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3602
 *     cdef wrap(const shared_ptr[CScanner]& sp):
 *         cdef Scanner self = Scanner.__new__(Scanner)
 *         self.init(sp)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Scanner *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, __pyx_v_sp); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3602, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3603
 *         cdef Scanner self = Scanner.__new__(Scanner)
 *         self.init(sp)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef inline shared_ptr[CScanner] unwrap(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3599
 *         self.scanner = sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(const shared_ptr[CScanner]& sp):
 *         cdef Scanner self = Scanner.__new__(Scanner)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3605
 *         return self
 * 
 *     cdef inline shared_ptr[CScanner] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

static std::shared_ptr<arrow::dataset::Scanner>  __pyx_f_7pyarrow_8_dataset_7Scanner_unwrap(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_r;

  /* "pyarrow/_dataset.pyx":3606
 * 
 *     cdef inline shared_ptr[CScanner] unwrap(self):
 *         return self.wrapped             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_r = __pyx_v_self->wrapped;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3605
 *         return self
 * 
 *     cdef inline shared_ptr[CScanner] unwrap(self):             # <<<<<<<<<<<<<<
 *         return self.wrapped
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3608
 *         return self.wrapped
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CScanOptions] _make_scan_options(Dataset dataset, dict py_scanoptions) except *:
 *         cdef:
*/

static std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_f_7pyarrow_8_dataset_7Scanner__make_scan_options(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_py_scanoptions) {
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_v_builder;
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_1;
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder __pyx_t_13;
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_scan_options", 0);
  __Pyx_INCREF(__pyx_v_py_scanoptions);

  /* "pyarrow/_dataset.pyx":3611
 *     cdef shared_ptr[CScanOptions] _make_scan_options(Dataset dataset, dict py_scanoptions) except *:
 *         cdef:
 *             shared_ptr[CScannerBuilder] builder = make_shared[CScannerBuilder](dataset.unwrap())             # <<<<<<<<<<<<<<
 * 
 *         py_scanoptions = dataset._scanner_options(py_scanoptions)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *)__pyx_v_dataset->__pyx_vtab)->unwrap(__pyx_v_dataset); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3611, __pyx_L1_error)
  try {
    __pyx_t_2 = std::make_shared<arrow::dataset::ScannerBuilder>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3611, __pyx_L1_error)
  }
  __pyx_v_builder = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":3613
 *             shared_ptr[CScannerBuilder] builder = make_shared[CScannerBuilder](dataset.unwrap())
 * 
 *         py_scanoptions = dataset._scanner_options(py_scanoptions)             # <<<<<<<<<<<<<<
 * 
 *         # Need to explicitly expand the arguments as Cython doesn't support
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_dataset);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_py_scanoptions};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scanner_options, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_3))) __PYX_ERR(0, 3613, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_py_scanoptions, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "pyarrow/_dataset.pyx":3619
 *         _populate_builder(
 *             builder,
 *             columns=py_scanoptions.get("columns"),             # <<<<<<<<<<<<<<
 *             filter=py_scanoptions.get("filter"),
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3619, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_columns, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":3620
 *             builder,
 *             columns=py_scanoptions.get("columns"),
 *             filter=py_scanoptions.get("filter"),             # <<<<<<<<<<<<<<
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),
 *             batch_readahead=py_scanoptions.get(
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3620, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_filter, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression))))) __PYX_ERR(0, 3620, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3621
 *             columns=py_scanoptions.get("columns"),
 *             filter=py_scanoptions.get("filter"),
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),             # <<<<<<<<<<<<<<
 *             batch_readahead=py_scanoptions.get(
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3621, __pyx_L1_error)
  }
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pyarrow/_dataset.pyx":3622
 *             filter=py_scanoptions.get("filter"),
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),
 *             batch_readahead=py_scanoptions.get(             # <<<<<<<<<<<<<<
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
 *             fragment_readahead=py_scanoptions.get(
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3622, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":3623
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),
 *             batch_readahead=py_scanoptions.get(
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),             # <<<<<<<<<<<<<<
 *             fragment_readahead=py_scanoptions.get(
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":3622
 *             filter=py_scanoptions.get("filter"),
 *             batch_size=py_scanoptions.get("batch_size", _DEFAULT_BATCH_SIZE),
 *             batch_readahead=py_scanoptions.get(             # <<<<<<<<<<<<<<
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
 *             fragment_readahead=py_scanoptions.get(
*/
  __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_dataset.pyx":3624
 *             batch_readahead=py_scanoptions.get(
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
 *             fragment_readahead=py_scanoptions.get(             # <<<<<<<<<<<<<<
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),
 *             use_threads=py_scanoptions.get("use_threads", True),
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3624, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":3625
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
 *             fragment_readahead=py_scanoptions.get(
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),             # <<<<<<<<<<<<<<
 *             use_threads=py_scanoptions.get("use_threads", True),
 *             cache_metadata=py_scanoptions.get("cache_metadata", True),
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":3624
 *             batch_readahead=py_scanoptions.get(
 *                 "batch_readahead", _DEFAULT_BATCH_READAHEAD),
 *             fragment_readahead=py_scanoptions.get(             # <<<<<<<<<<<<<<
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),
 *             use_threads=py_scanoptions.get("use_threads", True),
*/
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pyarrow/_dataset.pyx":3626
 *             fragment_readahead=py_scanoptions.get(
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),
 *             use_threads=py_scanoptions.get("use_threads", True),             # <<<<<<<<<<<<<<
 *             cache_metadata=py_scanoptions.get("cache_metadata", True),
 *             memory_pool=py_scanoptions.get("memory_pool"),
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3626, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_use_threads, Py_True); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pyarrow/_dataset.pyx":3627
 *                 "fragment_readahead", _DEFAULT_FRAGMENT_READAHEAD),
 *             use_threads=py_scanoptions.get("use_threads", True),
 *             cache_metadata=py_scanoptions.get("cache_metadata", True),             # <<<<<<<<<<<<<<
 *             memory_pool=py_scanoptions.get("memory_pool"),
 *             fragment_scan_options=py_scanoptions.get("fragment_scan_options"))
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3627, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_cache_metadata, Py_True); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pyarrow/_dataset.pyx":3628
 *             use_threads=py_scanoptions.get("use_threads", True),
 *             cache_metadata=py_scanoptions.get("cache_metadata", True),
 *             memory_pool=py_scanoptions.get("memory_pool"),             # <<<<<<<<<<<<<<
 *             fragment_scan_options=py_scanoptions.get("fragment_scan_options"))
 * 
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3628, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_memory_pool, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(0, 3628, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3629
 *             cache_metadata=py_scanoptions.get("cache_metadata", True),
 *             memory_pool=py_scanoptions.get("memory_pool"),
 *             fragment_scan_options=py_scanoptions.get("fragment_scan_options"))             # <<<<<<<<<<<<<<
 * 
 *         return GetResultValue(deref(builder).GetScanOptions())
*/
  if (unlikely(__pyx_v_py_scanoptions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 3629, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_scanoptions, __pyx_mstate_global->__pyx_n_u_fragment_scan_options, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions))))) __PYX_ERR(0, 3629, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3617
 *         # Need to explicitly expand the arguments as Cython doesn't support
 *         # keyword expansion in cdef functions.
 *         _populate_builder(             # <<<<<<<<<<<<<<
 *             builder,
 *             columns=py_scanoptions.get("columns"),
*/
  __pyx_t_13.__pyx_n = 9;
  __pyx_t_13.columns = __pyx_t_3;
  __pyx_t_13.filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_t_4);
  __pyx_t_13.batch_size = __pyx_t_8;
  __pyx_t_13.batch_readahead = __pyx_t_9;
  __pyx_t_13.fragment_readahead = __pyx_t_10;
  __pyx_t_13.use_threads = __pyx_t_11;
  __pyx_t_13.cache_metadata = __pyx_t_12;
  __pyx_t_13.memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_t_7);
  __pyx_t_13.fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)__pyx_t_6);
  __pyx_f_7pyarrow_8_dataset__populate_builder(__pyx_v_builder, &__pyx_t_13); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_dataset.pyx":3631
 *             fragment_scan_options=py_scanoptions.get("fragment_scan_options"))
 * 
 *         return GetResultValue(deref(builder).GetScanOptions())             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_14 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::ScanOptions> >((*__pyx_v_builder).GetScanOptions()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3631, __pyx_L1_error)
  __pyx_r = __pyx_t_14;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3608
 *         return self.wrapped
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CScanOptions] _make_scan_options(Dataset dataset, dict py_scanoptions) except *:
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._dataset.Scanner._make_scan_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_scanoptions);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3633
 *         return GetResultValue(deref(builder).GetScanOptions())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_3from_dataset(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_2from_dataset, "Scanner.from_dataset(Dataset dataset, *, columns=None, filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nCreate Scanner from Dataset,\n\nParameters\n----------\ndataset : Dataset\n    Dataset to scan.\ncolumns : list[str] or dict[str, Expression], default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_reada""head : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_3from_dataset = {"from_dataset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_3from_dataset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_2from_dataset};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_3from_dataset(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_dataset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dataset,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3633, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "from_dataset", 0) < (0)) __PYX_ERR(0, 3633, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3635
 *     @staticmethod
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,             # <<<<<<<<<<<<<<
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3636
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
 *                      object filter=None,             # <<<<<<<<<<<<<<
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3640
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3642
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Dataset,
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_dataset", 1, 1, 1, i); __PYX_ERR(0, 3633, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3633, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3635
 *     @staticmethod
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,             # <<<<<<<<<<<<<<
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3636
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
 *                      object filter=None,             # <<<<<<<<<<<<<<
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3640
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
      if (!values[6]) values[6] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3642
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Dataset,
*/
      if (!values[9]) values[9] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_dataset = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)values[0]);
    __pyx_v_columns = values[1];
    __pyx_v_filter = values[2];
    if (values[3]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__47;
    }
    if (values[4]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__48;
    }
    if (values[5]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__49;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[6]);
    if (values[7]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3641, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":3641
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                      MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[8]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3641, __pyx_L3_error)
    } else {
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[9]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dataset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3633, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.from_dataset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dataset), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, 0, "dataset", 0))) __PYX_ERR(0, 3634, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 3640, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 3642, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_2from_dataset(__pyx_v_dataset, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":3633
 *         return GetResultValue(deref(builder).GetScanOptions())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_2from_dataset(struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_columns, PyObject *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_v_options;
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_v_builder;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_v_scanner;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_t_3;
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_4;
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_t_5;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_dataset", 0);

  /* "pyarrow/_dataset.pyx":3706
 *         options = Scanner._make_scan_options(
 *             dataset,
 *             dict(columns=columns, filter=filter, batch_size=batch_size,             # <<<<<<<<<<<<<<
 *                  batch_readahead=batch_readahead,
 *                  fragment_readahead=fragment_readahead, use_threads=use_threads,
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_columns, __pyx_v_columns) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_filter, __pyx_v_filter) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_batch_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_2) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3707
 *             dataset,
 *             dict(columns=columns, filter=filter, batch_size=batch_size,
 *                  batch_readahead=batch_readahead,             # <<<<<<<<<<<<<<
 *                  fragment_readahead=fragment_readahead, use_threads=use_threads,
 *                  cache_metadata=cache_metadata, memory_pool=memory_pool,
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_batch_readahead); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_2) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3708
 *             dict(columns=columns, filter=filter, batch_size=batch_size,
 *                  batch_readahead=batch_readahead,
 *                  fragment_readahead=fragment_readahead, use_threads=use_threads,             # <<<<<<<<<<<<<<
 *                  cache_metadata=cache_metadata, memory_pool=memory_pool,
 *                  fragment_scan_options=fragment_scan_options)
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_fragment_readahead); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_2) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_use_threads, __pyx_t_2) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3709
 *                  batch_readahead=batch_readahead,
 *                  fragment_readahead=fragment_readahead, use_threads=use_threads,
 *                  cache_metadata=cache_metadata, memory_pool=memory_pool,             # <<<<<<<<<<<<<<
 *                  fragment_scan_options=fragment_scan_options)
 *         )
*/
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_cache_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cache_metadata, __pyx_t_2) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3710
 *                  fragment_readahead=fragment_readahead, use_threads=use_threads,
 *                  cache_metadata=cache_metadata, memory_pool=memory_pool,
 *                  fragment_scan_options=fragment_scan_options)             # <<<<<<<<<<<<<<
 *         )
 *         builder = make_shared[CScannerBuilder](dataset.unwrap(), options)
*/
  if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fragment_scan_options, ((PyObject *)__pyx_v_fragment_scan_options)) < (0)) __PYX_ERR(0, 3706, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3704
 *             shared_ptr[CScanner] scanner
 * 
 *         options = Scanner._make_scan_options(             # <<<<<<<<<<<<<<
 *             dataset,
 *             dict(columns=columns, filter=filter, batch_size=batch_size,
*/
  __pyx_t_3 = __pyx_f_7pyarrow_8_dataset_7Scanner__make_scan_options(__pyx_v_dataset, ((PyObject*)__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_dataset.pyx":3712
 *                  fragment_scan_options=fragment_scan_options)
 *         )
 *         builder = make_shared[CScannerBuilder](dataset.unwrap(), options)             # <<<<<<<<<<<<<<
 *         scanner = GetResultValue(builder.get().Finish())
 *         return Scanner.wrap(scanner)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *)__pyx_v_dataset->__pyx_vtab)->unwrap(__pyx_v_dataset); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3712, __pyx_L1_error)
  try {
    __pyx_t_5 = std::make_shared<arrow::dataset::ScannerBuilder>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4), __pyx_v_options);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3712, __pyx_L1_error)
  }
  __pyx_v_builder = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_dataset.pyx":3713
 *         )
 *         builder = make_shared[CScannerBuilder](dataset.unwrap(), options)
 *         scanner = GetResultValue(builder.get().Finish())             # <<<<<<<<<<<<<<
 *         return Scanner.wrap(scanner)
 * 
*/
  __pyx_t_6 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Scanner> >(__pyx_v_builder.get()->Finish()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3713, __pyx_L1_error)
  __pyx_v_scanner = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_dataset.pyx":3714
 *         builder = make_shared[CScannerBuilder](dataset.unwrap(), options)
 *         scanner = GetResultValue(builder.get().Finish())
 *         return Scanner.wrap(scanner)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_7Scanner_wrap(__pyx_v_scanner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3633
 *         return GetResultValue(deref(builder).GetScanOptions())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
*/

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

/* "pyarrow/_dataset.pyx":3716
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_5from_fragment(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_4from_fragment, "Scanner.from_fragment(Fragment fragment, *, Schema schema=None, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nCreate Scanner from Fragment,\n\nParameters\n----------\nfragment : Fragment\n    fragment to scan.\nschema : Schema, optional\n    The schema of the fragment.\ncolumns : list[str] or dict[str, Expression], default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's Schema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record bat""ches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_5from_fragment = {"from_fragment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_5from_fragment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_4from_fragment};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_5from_fragment(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_fragment = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_fragment (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fragment,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3716, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3716, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "from_fragment", 0) < (0)) __PYX_ERR(0, 3716, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3717
 * 
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,             # <<<<<<<<<<<<<<
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":3718
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,             # <<<<<<<<<<<<<<
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":3722
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3724
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Fragment,
*/
      if (!values[10]) values[10] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_fragment", 1, 1, 1, i); __PYX_ERR(0, 3716, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3716, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3717
 * 
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,             # <<<<<<<<<<<<<<
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));

      /* "pyarrow/_dataset.pyx":3718
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,             # <<<<<<<<<<<<<<
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":3722
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3724
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Fragment,
*/
      if (!values[10]) values[10] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_fragment = ((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)values[0]);
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_columns = values[2];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[3]);
    if (values[4]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3719, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__50;
    }
    if (values[5]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3720, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__51;
    }
    if (values[6]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3721, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__52;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[7]);
    if (values[8]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3723, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":3723
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                       MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[9]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3723, __pyx_L3_error)
    } else {
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[10]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_fragment", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3716, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.from_fragment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, 0, "fragment", 0))) __PYX_ERR(0, 3717, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 3717, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 3718, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 3722, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 3724, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_4from_fragment(__pyx_v_fragment, __pyx_v_schema, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":3716
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_4from_fragment(struct __pyx_obj_7pyarrow_8_dataset_Fragment *__pyx_v_fragment, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_v_options;
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_v_builder;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_v_scanner;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::shared_ptr< arrow::Schema>  __pyx_t_5;
  std::shared_ptr<arrow::dataset::Fragment>  __pyx_t_6;
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_t_7;
  struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder __pyx_t_8;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_fragment", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_schema);

  /* "pyarrow/_dataset.pyx":3784
 *         """
 *         cdef:
 *             shared_ptr[CScanOptions] options = make_shared[CScanOptions]()             # <<<<<<<<<<<<<<
 *             shared_ptr[CScannerBuilder] builder
 *             shared_ptr[CScanner] scanner
*/
  try {
    __pyx_t_1 = std::make_shared<arrow::dataset::ScanOptions>();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3784, __pyx_L1_error)
  }
  __pyx_v_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":3788
 *             shared_ptr[CScanner] scanner
 * 
 *         schema = schema or fragment.physical_schema             # <<<<<<<<<<<<<<
 * 
 *         builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_schema)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3788, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __Pyx_INCREF((PyObject *)__pyx_v_schema);
    __pyx_t_2 = ((PyObject *)__pyx_v_schema);
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_fragment), __pyx_mstate_global->__pyx_n_u_physical_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(0, 3788, __pyx_L1_error)
  __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_schema, ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3790
 *         schema = schema or fragment.physical_schema
 * 
 *         builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *                                                fragment.unwrap(), options)
 *         _populate_builder(builder, columns=columns, filter=filter,
*/
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3790, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3791
 * 
 *         builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),
 *                                                fragment.unwrap(), options)             # <<<<<<<<<<<<<<
 *         _populate_builder(builder, columns=columns, filter=filter,
 *                           batch_size=batch_size, batch_readahead=batch_readahead,
*/
  __pyx_t_6 = __pyx_f_7pyarrow_8_dataset_8Fragment_unwrap(__pyx_v_fragment); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3791, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3790
 *         schema = schema or fragment.physical_schema
 * 
 *         builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),             # <<<<<<<<<<<<<<
 *                                                fragment.unwrap(), options)
 *         _populate_builder(builder, columns=columns, filter=filter,
*/
  try {
    __pyx_t_7 = std::make_shared<arrow::dataset::ScannerBuilder>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6), __pyx_v_options);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 3790, __pyx_L1_error)
  }
  __pyx_v_builder = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pyarrow/_dataset.pyx":3792
 *         builder = make_shared[CScannerBuilder](pyarrow_unwrap_schema(schema),
 *                                                fragment.unwrap(), options)
 *         _populate_builder(builder, columns=columns, filter=filter,             # <<<<<<<<<<<<<<
 *                           batch_size=batch_size, batch_readahead=batch_readahead,
 *                           fragment_readahead=fragment_readahead,
*/
  __pyx_t_8.__pyx_n = 9;
  __pyx_t_8.columns = __pyx_v_columns;
  __pyx_t_8.filter = __pyx_v_filter;
  __pyx_t_8.batch_size = __pyx_v_batch_size;
  __pyx_t_8.batch_readahead = __pyx_v_batch_readahead;
  __pyx_t_8.fragment_readahead = __pyx_v_fragment_readahead;
  __pyx_t_8.use_threads = __pyx_v_use_threads;
  __pyx_t_8.cache_metadata = __pyx_v_cache_metadata;
  __pyx_t_8.memory_pool = __pyx_v_memory_pool;
  __pyx_t_8.fragment_scan_options = __pyx_v_fragment_scan_options;
  __pyx_f_7pyarrow_8_dataset__populate_builder(__pyx_v_builder, &__pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3792, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3799
 *                           fragment_scan_options=fragment_scan_options)
 * 
 *         scanner = GetResultValue(builder.get().Finish())             # <<<<<<<<<<<<<<
 *         return Scanner.wrap(scanner)
 * 
*/
  __pyx_t_9 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Scanner> >(__pyx_v_builder.get()->Finish()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3799, __pyx_L1_error)
  __pyx_v_scanner = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pyarrow/_dataset.pyx":3800
 * 
 *         scanner = GetResultValue(builder.get().Finish())
 *         return Scanner.wrap(scanner)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_7Scanner_wrap(__pyx_v_scanner); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3716
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.from_fragment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3802
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_7from_batches(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_6from_batches, "Scanner.from_batches(source, *, Schema schema=None, columns=None, Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE, int batch_readahead=_DEFAULT_BATCH_READAHEAD, int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD, FragmentScanOptions fragment_scan_options=None, bool use_threads=True, bool cache_metadata=True, MemoryPool memory_pool=None)\n\nCreate a Scanner from an iterator of batches.\n\nThis creates a scanner which can be used only once. It is\nintended to support writing a dataset (which takes a scanner)\nfrom a source which can be read only once (e.g. a\nRecordBatchReader or generator).\n\nParameters\n----------\nsource : Iterator or Arrow-compatible stream object\n    The iterator of Batches. This can be a pyarrow RecordBatchReader,\n    any object that implements the Arrow PyCapsule Protocol for\n    streams, or an actual Python iterator of RecordBatches.\nschema : Schema\n    The schema of the batches (required when passing a Python\n    iterator).\ncolumns : list[str] or dict[str, Expression], default None\n    The columns to project. This can be a list of column names to\n    include (order and duplicates will be preserved), or a dictionary\n    with {new_column_name: expression} values for more advanced\n    projections.\n\n    The list of columns or expressions may use the special fields\n    `__batch_index` (the index of the batch within the fragment),\n    `__fragment_index` (the index of the fragment within the dataset),\n    `__last_in_fragment` (whether the batch is last in fragment), and\n    `__filename` (the name of the source file or a description of the\n    source fragment).\n\n    The columns will be passed down to Datasets and corresponding data\n    fragments to avoid loading, copying, and deserializing columns\n    that will not be required further down the compute chain.\n    By default all of the available columns are projected. Raises\n    an exception if any of the referenced column names does not exist\n    in the dataset's S""chema.\nfilter : Expression, default None\n    Scan will return only the rows matching the filter.\n    If possible the predicate will be pushed down to exploit the\n    partition information or internal metadata found in the data\n    source, e.g. Parquet statistics. Otherwise filters the loaded\n    RecordBatches before yielding them.\nbatch_size : int, default 131_072\n    The maximum row count for scanned record batches. If scanned\n    record batches are overflowing memory then this method can be\n    called to reduce their size.\nbatch_readahead : int, default 16\n    The number of batches to read ahead in a file. This might not work\n    for all file formats. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_readahead : int, default 4\n    The number of files to read ahead. Increasing this number will increase\n    RAM usage but could also improve IO utilization.\nfragment_scan_options : FragmentScanOptions, default None\n    Options specific to a particular scan and fragment type, which\n    can change between different scans of the same dataset.\nuse_threads : bool, default True\n    If enabled, then maximum parallelism will be used determined by\n    the number of available CPU cores.\ncache_metadata : bool, default True\n    If enabled, metadata may be cached when scanning to speed up\n    repeated scans.\nmemory_pool : MemoryPool, default None\n    For memory allocations, if required. If not specified, uses the\n    default pool.");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_7from_batches = {"from_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_7from_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_6from_batches};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_7from_batches(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_columns = 0;
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter = 0;
  int __pyx_v_batch_size;
  int __pyx_v_batch_readahead;
  int __pyx_v_fragment_readahead;
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options = 0;
  int __pyx_v_use_threads;
  int __pyx_v_cache_metadata;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_batches (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_columns,&__pyx_mstate_global->__pyx_n_u_filter,&__pyx_mstate_global->__pyx_n_u_batch_size,&__pyx_mstate_global->__pyx_n_u_batch_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_readahead,&__pyx_mstate_global->__pyx_n_u_fragment_scan_options,&__pyx_mstate_global->__pyx_n_u_use_threads,&__pyx_mstate_global->__pyx_n_u_cache_metadata,&__pyx_mstate_global->__pyx_n_u_memory_pool,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3802, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3802, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "from_batches", 0) < (0)) __PYX_ERR(0, 3802, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3803
 * 
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,             # <<<<<<<<<<<<<<
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3804
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":3807
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3809
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Scanner from an iterator of batches.
*/
      if (!values[10]) values[10] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("from_batches", 1, 1, 1, i); __PYX_ERR(0, 3802, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3802, __pyx_L3_error)

      /* "pyarrow/_dataset.pyx":3803
 * 
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,             # <<<<<<<<<<<<<<
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_Schema *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_dataset.pyx":3804
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None));

      /* "pyarrow/_dataset.pyx":3807
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)Py_None));

      /* "pyarrow/_dataset.pyx":3809
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Scanner from an iterator of batches.
*/
      if (!values[10]) values[10] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)Py_None));
    }
    __pyx_v_source = values[0];
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_columns = values[2];
    __pyx_v_filter = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[3]);
    if (values[4]) {
      __pyx_v_batch_size = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_batch_size == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3804, __pyx_L3_error)
    } else {
      __pyx_v_batch_size = __pyx_mstate_global->__pyx_k__53;
    }
    if (values[5]) {
      __pyx_v_batch_readahead = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_batch_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3805, __pyx_L3_error)
    } else {
      __pyx_v_batch_readahead = __pyx_mstate_global->__pyx_k__54;
    }
    if (values[6]) {
      __pyx_v_fragment_readahead = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_fragment_readahead == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L3_error)
    } else {
      __pyx_v_fragment_readahead = __pyx_mstate_global->__pyx_k__55;
    }
    __pyx_v_fragment_scan_options = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)values[7]);
    if (values[8]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3808, __pyx_L3_error)
    } else {

      /* "pyarrow/_dataset.pyx":3808
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                      MemoryPool memory_pool=None):
 *         """
*/
      __pyx_v_use_threads = ((int)1);
    }
    if (values[9]) {
      __pyx_v_cache_metadata = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_cache_metadata == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3808, __pyx_L3_error)
    } else {
      __pyx_v_cache_metadata = ((int)1);
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[10]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_batches", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3802, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.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_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 3803, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filter), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "filter", 0))) __PYX_ERR(0, 3804, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fragment_scan_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, 1, "fragment_scan_options", 0))) __PYX_ERR(0, 3807, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(0, 3809, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_6from_batches(__pyx_v_source, __pyx_v_schema, __pyx_v_columns, __pyx_v_filter, __pyx_v_batch_size, __pyx_v_batch_readahead, __pyx_v_fragment_readahead, __pyx_v_fragment_scan_options, __pyx_v_use_threads, __pyx_v_cache_metadata, __pyx_v_memory_pool);

  /* "pyarrow/_dataset.pyx":3802
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_6from_batches(PyObject *__pyx_v_source, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_columns, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_filter, int __pyx_v_batch_size, int __pyx_v_batch_readahead, int __pyx_v_fragment_readahead, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *__pyx_v_fragment_scan_options, int __pyx_v_use_threads, int __pyx_v_cache_metadata, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::shared_ptr<arrow::dataset::ScannerBuilder>  __pyx_v_builder;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_v_scanner;
  struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *__pyx_v_reader = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  struct __pyx_opt_args_7pyarrow_8_dataset__populate_builder __pyx_t_7;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_batches", 0);

  /* "pyarrow/_dataset.pyx":3880
 *             shared_ptr[CScanner] scanner
 *             RecordBatchReader reader
 *         if isinstance(source, pa.ipc.RecordBatchReader):             # <<<<<<<<<<<<<<
 *             if schema:
 *                 raise ValueError('Cannot specify a schema when providing '
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ipc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3880, __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_mstate_global->__pyx_n_u_RecordBatchReader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_source, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":3881
 *             RecordBatchReader reader
 *         if isinstance(source, pa.ipc.RecordBatchReader):
 *             if schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Cannot specify a schema when providing '
 *                                  'a RecordBatchReader')
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_schema)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3881, __pyx_L1_error)
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/_dataset.pyx":3882
 *         if isinstance(source, pa.ipc.RecordBatchReader):
 *             if schema:
 *                 raise ValueError('Cannot specify a schema when providing '             # <<<<<<<<<<<<<<
 *                                  'a RecordBatchReader')
 *             reader = source
*/
      __pyx_t_2 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Cannot_specify_a_schema_when_pro};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3882, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3882, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":3881
 *             RecordBatchReader reader
 *         if isinstance(source, pa.ipc.RecordBatchReader):
 *             if schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Cannot specify a schema when providing '
 *                                  'a RecordBatchReader')
*/
    }

    /* "pyarrow/_dataset.pyx":3884
 *                 raise ValueError('Cannot specify a schema when providing '
 *                                  'a RecordBatchReader')
 *             reader = source             # <<<<<<<<<<<<<<
 *         elif hasattr(source, "__arrow_c_stream__"):
 *             if schema:
*/
    __pyx_t_1 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader))))) __PYX_ERR(0, 3884, __pyx_L1_error)
    __pyx_v_reader = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":3880
 *             shared_ptr[CScanner] scanner
 *             RecordBatchReader reader
 *         if isinstance(source, pa.ipc.RecordBatchReader):             # <<<<<<<<<<<<<<
 *             if schema:
 *                 raise ValueError('Cannot specify a schema when providing '
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3885
 *                                  'a RecordBatchReader')
 *             reader = source
 *         elif hasattr(source, "__arrow_c_stream__"):             # <<<<<<<<<<<<<<
 *             if schema:
 *                 raise ValueError(
*/
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_source, __pyx_mstate_global->__pyx_n_u_arrow_c_stream); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3885, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_dataset.pyx":3886
 *             reader = source
 *         elif hasattr(source, "__arrow_c_stream__"):
 *             if schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'Cannot specify a schema when providing an object '
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_schema)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 3886, __pyx_L1_error)
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/_dataset.pyx":3887
 *         elif hasattr(source, "__arrow_c_stream__"):
 *             if schema:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'Cannot specify a schema when providing an object '
 *                     'implementing the Arrow PyCapsule Protocol')
*/
      __pyx_t_2 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Cannot_specify_a_schema_when_pro_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3887, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3887, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":3886
 *             reader = source
 *         elif hasattr(source, "__arrow_c_stream__"):
 *             if schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'Cannot specify a schema when providing an object '
*/
    }

    /* "pyarrow/_dataset.pyx":3890
 *                     'Cannot specify a schema when providing an object '
 *                     'implementing the Arrow PyCapsule Protocol')
 *             reader = pa.ipc.RecordBatchReader.from_stream(source)             # <<<<<<<<<<<<<<
 *         elif _is_iterable(source):
 *             if schema is None:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ipc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RecordBatchReader); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_source};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_stream, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader))))) __PYX_ERR(0, 3890, __pyx_L1_error)
    __pyx_v_reader = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":3885
 *                                  'a RecordBatchReader')
 *             reader = source
 *         elif hasattr(source, "__arrow_c_stream__"):             # <<<<<<<<<<<<<<
 *             if schema:
 *                 raise ValueError(
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3891
 *                     'implementing the Arrow PyCapsule Protocol')
 *             reader = pa.ipc.RecordBatchReader.from_stream(source)
 *         elif _is_iterable(source):             # <<<<<<<<<<<<<<
 *             if schema is None:
 *                 raise ValueError('Must provide schema to construct scanner '
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_is_iterable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_source};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3891, __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(0, 3891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_3)) {

    /* "pyarrow/_dataset.pyx":3892
 *             reader = pa.ipc.RecordBatchReader.from_stream(source)
 *         elif _is_iterable(source):
 *             if schema is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must provide schema to construct scanner '
 *                                  'from an iterable')
*/
    __pyx_t_3 = (((PyObject *)__pyx_v_schema) == Py_None);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/_dataset.pyx":3893
 *         elif _is_iterable(source):
 *             if schema is None:
 *                 raise ValueError('Must provide schema to construct scanner '             # <<<<<<<<<<<<<<
 *                                  'from an iterable')
 *             reader = pa.ipc.RecordBatchReader.from_batches(schema, source)
*/
      __pyx_t_2 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Must_provide_schema_to_construct_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3893, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 3893, __pyx_L1_error)

      /* "pyarrow/_dataset.pyx":3892
 *             reader = pa.ipc.RecordBatchReader.from_stream(source)
 *         elif _is_iterable(source):
 *             if schema is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must provide schema to construct scanner '
 *                                  'from an iterable')
*/
    }

    /* "pyarrow/_dataset.pyx":3895
 *                 raise ValueError('Must provide schema to construct scanner '
 *                                  'from an iterable')
 *             reader = pa.ipc.RecordBatchReader.from_batches(schema, source)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Expected a RecordBatchReader or an iterable of '
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ipc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RecordBatchReader); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_schema), __pyx_v_source};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_batches, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader))))) __PYX_ERR(0, 3895, __pyx_L1_error)
    __pyx_v_reader = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_dataset.pyx":3891
 *                     'implementing the Arrow PyCapsule Protocol')
 *             reader = pa.ipc.RecordBatchReader.from_stream(source)
 *         elif _is_iterable(source):             # <<<<<<<<<<<<<<
 *             if schema is None:
 *                 raise ValueError('Must provide schema to construct scanner '
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":3897
 *             reader = pa.ipc.RecordBatchReader.from_batches(schema, source)
 *         else:
 *             raise TypeError('Expected a RecordBatchReader or an iterable of '             # <<<<<<<<<<<<<<
 *                             'batches instead of the given type: ' +
 *                             type(source).__name__)
*/
  /*else*/ {
    __pyx_t_5 = NULL;

    /* "pyarrow/_dataset.pyx":3899
 *             raise TypeError('Expected a RecordBatchReader or an iterable of '
 *                             'batches instead of the given type: ' +
 *                             type(source).__name__)             # <<<<<<<<<<<<<<
 *         builder = CScannerBuilder.FromRecordBatchReader(reader.reader)
 *         _populate_builder(builder, columns=columns, filter=filter,
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_source)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "pyarrow/_dataset.pyx":3898
 *         else:
 *             raise TypeError('Expected a RecordBatchReader or an iterable of '
 *                             'batches instead of the given type: ' +             # <<<<<<<<<<<<<<
 *                             type(source).__name__)
 *         builder = CScannerBuilder.FromRecordBatchReader(reader.reader)
*/
    __pyx_t_6 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u_Expected_a_RecordBatchReader_or, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3897, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":3900
 *                             'batches instead of the given type: ' +
 *                             type(source).__name__)
 *         builder = CScannerBuilder.FromRecordBatchReader(reader.reader)             # <<<<<<<<<<<<<<
 *         _populate_builder(builder, columns=columns, filter=filter,
 *                           batch_size=batch_size, batch_readahead=batch_readahead,
*/
  __pyx_v_builder = arrow::dataset::ScannerBuilder::FromRecordBatchReader(__pyx_v_reader->reader);

  /* "pyarrow/_dataset.pyx":3901
 *                             type(source).__name__)
 *         builder = CScannerBuilder.FromRecordBatchReader(reader.reader)
 *         _populate_builder(builder, columns=columns, filter=filter,             # <<<<<<<<<<<<<<
 *                           batch_size=batch_size, batch_readahead=batch_readahead,
 *                           fragment_readahead=fragment_readahead, use_threads=use_threads,
*/
  __pyx_t_7.__pyx_n = 9;
  __pyx_t_7.columns = __pyx_v_columns;
  __pyx_t_7.filter = __pyx_v_filter;
  __pyx_t_7.batch_size = __pyx_v_batch_size;
  __pyx_t_7.batch_readahead = __pyx_v_batch_readahead;
  __pyx_t_7.fragment_readahead = __pyx_v_fragment_readahead;
  __pyx_t_7.use_threads = __pyx_v_use_threads;
  __pyx_t_7.cache_metadata = __pyx_v_cache_metadata;
  __pyx_t_7.memory_pool = __pyx_v_memory_pool;
  __pyx_t_7.fragment_scan_options = __pyx_v_fragment_scan_options;
  __pyx_f_7pyarrow_8_dataset__populate_builder(__pyx_v_builder, &__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3901, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3906
 *                           cache_metadata=cache_metadata, memory_pool=memory_pool,
 *                           fragment_scan_options=fragment_scan_options)
 *         scanner = GetResultValue(builder.get().Finish())             # <<<<<<<<<<<<<<
 *         return Scanner.wrap(scanner)
 * 
*/
  __pyx_t_8 = arrow::py::GetResultValue<std::shared_ptr<arrow::dataset::Scanner> >(__pyx_v_builder.get()->Finish()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3906, __pyx_L1_error)
  __pyx_v_scanner = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":3907
 *                           fragment_scan_options=fragment_scan_options)
 *         scanner = GetResultValue(builder.get().Finish())
 *         return Scanner.wrap(scanner)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_7Scanner_wrap(__pyx_v_scanner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3802
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
*/

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

/* "pyarrow/_dataset.pyx":3909
 *         return Scanner.wrap(scanner)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dataset_schema(self):
 *         """The schema with which batches will be read from fragments."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_14dataset_schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_14dataset_schema_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_14dataset_schema___get__(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_14dataset_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3912
 *     def dataset_schema(self):
 *         """The schema with which batches will be read from fragments."""
 *         return pyarrow_wrap_schema(             # <<<<<<<<<<<<<<
 *             self.scanner.options().get().dataset_schema)
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":3913
 *         """The schema with which batches will be read from fragments."""
 *         return pyarrow_wrap_schema(
 *             self.scanner.options().get().dataset_schema)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->scanner->options().get()->dataset_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3909
 *         return Scanner.wrap(scanner)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dataset_schema(self):
 *         """The schema with which batches will be read from fragments."""
*/

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

/* "pyarrow/_dataset.pyx":3915
 *             self.scanner.options().get().dataset_schema)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def projected_schema(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_16projected_schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_16projected_schema_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_16projected_schema___get__(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_16projected_schema___get__(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_dataset.pyx":3922
 *         This is the schema of any data returned from the scanner.
 *         """
 *         return pyarrow_wrap_schema(             # <<<<<<<<<<<<<<
 *             self.scanner.options().get().projected_schema)
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_dataset.pyx":3923
 *         """
 *         return pyarrow_wrap_schema(
 *             self.scanner.options().get().projected_schema)             # <<<<<<<<<<<<<<
 * 
 *     def to_batches(self):
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->scanner->options().get()->projected_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3915
 *             self.scanner.options().get().dataset_schema)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def projected_schema(self):
 *         """
*/

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

/* "pyarrow/_dataset.pyx":3925
 *             self.scanner.options().get().projected_schema)
 * 
 *     def to_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_9to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_8to_batches, "Scanner.to_batches(self)\n\nConsume a Scanner in record batches.\n\nReturns\n-------\nrecord_batches : iterator of RecordBatch");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_9to_batches = {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_9to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_8to_batches};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_9to_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("to_batches", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("to_batches", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_8to_batches(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_8_dataset_7Scanner_10to_batches_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/_dataset.pyx":3933
 *         record_batches : iterator of RecordBatch
 *         """
 *         def _iterator(batch_iter):             # <<<<<<<<<<<<<<
 *             for batch in batch_iter:
 *                 yield batch.record_batch
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_10to_batches_1_iterator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_10to_batches_1_iterator = {"_iterator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_10to_batches_1_iterator, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_10to_batches_1_iterator(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_batch_iter = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_iterator (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_batch_iter,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3933, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_iterator", 0) < (0)) __PYX_ERR(0, 3933, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_iterator", 1, 1, 1, i); __PYX_ERR(0, 3933, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3933, __pyx_L3_error)
    }
    __pyx_v_batch_iter = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_iterator", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3933, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.to_batches._iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_10to_batches__iterator(__pyx_self, __pyx_v_batch_iter);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_10to_batches__iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_batch_iter) {
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_iterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct_1__iterator(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 3933, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_batch_iter = __pyx_v_batch_iter;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_batch_iter);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_batch_iter);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_8_dataset_7Scanner_10to_batches_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_iterator, __pyx_mstate_global->__pyx_n_u_to_batches_locals__iterator, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset); if (unlikely(!gen)) __PYX_ERR(0, 3933, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.to_batches._iterator", __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_8_dataset_7Scanner_10to_batches_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_iterator", 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 != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 3933, __pyx_L1_error)
  }

  /* "pyarrow/_dataset.pyx":3934
 *         """
 *         def _iterator(batch_iter):
 *             for batch in batch_iter:             # <<<<<<<<<<<<<<
 *                 yield batch.record_batch
 *         # Don't make ourselves a generator so errors are raised immediately
*/
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_batch_iter)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_batch_iter)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_batch_iter; __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_v_batch_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3934, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3934, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3934, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3934, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3934, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 3934, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_batch);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_batch, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":3935
 *         def _iterator(batch_iter):
 *             for batch in batch_iter:
 *                 yield batch.record_batch             # <<<<<<<<<<<<<<
 *         # Don't make ourselves a generator so errors are raised immediately
 *         return _iterator(self.scan_batches())
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_batch, __pyx_mstate_global->__pyx_n_u_record_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __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_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __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(0, 3935, __pyx_L1_error)

    /* "pyarrow/_dataset.pyx":3934
 *         """
 *         def _iterator(batch_iter):
 *             for batch in batch_iter:             # <<<<<<<<<<<<<<
 *                 yield batch.record_batch
 *         # Don't make ourselves a generator so errors are raised immediately
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/_dataset.pyx":3933
 *         record_batches : iterator of RecordBatch
 *         """
 *         def _iterator(batch_iter):             # <<<<<<<<<<<<<<
 *             for batch in batch_iter:
 *                 yield batch.record_batch
*/

  /* 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);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("_iterator", __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/_dataset.pyx":3925
 *             self.scanner.options().get().projected_schema)
 * 
 *     def to_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches.
*/

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_8to_batches(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  PyObject *__pyx_v__iterator = 0;
  PyObject *__pyx_gb_7pyarrow_8_dataset_7Scanner_10to_batches_2generator1 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_batches", 0);

  /* "pyarrow/_dataset.pyx":3933
 *         record_batches : iterator of RecordBatch
 *         """
 *         def _iterator(batch_iter):             # <<<<<<<<<<<<<<
 *             for batch in batch_iter:
 *                 yield batch.record_batch
*/
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_10to_batches_1_iterator, 0, __pyx_mstate_global->__pyx_n_u_to_batches_locals__iterator, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__iterator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":3937
 *                 yield batch.record_batch
 *         # Don't make ourselves a generator so errors are raised immediately
 *         return _iterator(self.scan_batches())             # <<<<<<<<<<<<<<
 * 
 *     def scan_batches(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scan_batches, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3937, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __pyx_pf_7pyarrow_8_dataset_7Scanner_10to_batches__iterator(__pyx_v__iterator, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3937, __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/_dataset.pyx":3925
 *             self.scanner.options().get().projected_schema)
 * 
 *     def to_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.to_batches", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__iterator);
  __Pyx_XDECREF(__pyx_gb_7pyarrow_8_dataset_7Scanner_10to_batches_2generator1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":3939
 *         return _iterator(self.scan_batches())
 * 
 *     def scan_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches with corresponding fragments.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_11scan_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_10scan_batches, "Scanner.scan_batches(self)\n\nConsume a Scanner in record batches with corresponding fragments.\n\nReturns\n-------\nrecord_batches : iterator of TaggedRecordBatch");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_11scan_batches = {"scan_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_11scan_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_10scan_batches};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_11scan_batches(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scan_batches (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("scan_batches", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("scan_batches", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_10scan_batches(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_10scan_batches(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  arrow::dataset::TaggedRecordBatchIterator __pyx_v_iterator;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  arrow::dataset::TaggedRecordBatchIterator __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scan_batches", 0);

  /* "pyarrow/_dataset.pyx":3948
 *         """
 *         cdef CTaggedRecordBatchIterator iterator
 *         with nogil:             # <<<<<<<<<<<<<<
 *             iterator = move(GetResultValue(self.scanner.ScanBatches()))
 *         # Don't make ourselves a generator so errors are raised immediately
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3949
 *         cdef CTaggedRecordBatchIterator iterator
 *         with nogil:
 *             iterator = move(GetResultValue(self.scanner.ScanBatches()))             # <<<<<<<<<<<<<<
 *         # Don't make ourselves a generator so errors are raised immediately
 *         return TaggedRecordBatchIterator.wrap(self, move(iterator))
*/
        __pyx_t_1 = arrow::py::GetResultValue<arrow::dataset::TaggedRecordBatchIterator>(__pyx_v_self->scanner->ScanBatches()); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3949, __pyx_L4_error)
        __pyx_v_iterator = cython_std::move<arrow::dataset::TaggedRecordBatchIterator>(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1));
      }

      /* "pyarrow/_dataset.pyx":3948
 *         """
 *         cdef CTaggedRecordBatchIterator iterator
 *         with nogil:             # <<<<<<<<<<<<<<
 *             iterator = move(GetResultValue(self.scanner.ScanBatches()))
 *         # Don't make ourselves a generator so errors are raised immediately
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":3951
 *             iterator = move(GetResultValue(self.scanner.ScanBatches()))
 *         # Don't make ourselves a generator so errors are raised immediately
 *         return TaggedRecordBatchIterator.wrap(self, move(iterator))             # <<<<<<<<<<<<<<
 * 
 *     def to_table(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset_25TaggedRecordBatchIterator_wrap(((PyObject *)__pyx_v_self), cython_std::move<arrow::dataset::TaggedRecordBatchIterator>(__pyx_v_iterator)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3939
 *         return _iterator(self.scan_batches())
 * 
 *     def scan_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches with corresponding fragments.
*/

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

/* "pyarrow/_dataset.pyx":3953
 *         return TaggedRecordBatchIterator.wrap(self, move(iterator))
 * 
 *     def to_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a Scanner into a Table.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_13to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_12to_table, "Scanner.to_table(self)\n\nConvert a Scanner into a Table.\n\nUse this convenience utility with care. This will serially materialize\nthe Scan result in memory before creating the Table.\n\nReturns\n-------\nTable");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_13to_table = {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_13to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_12to_table};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_13to_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("to_table", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("to_table", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_12to_table(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_12to_table(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  arrow::Result<std::shared_ptr< arrow::Table> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Table>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_table", 0);

  /* "pyarrow/_dataset.pyx":3966
 *         cdef CResult[shared_ptr[CTable]] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.ToTable()
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3967
 * 
 *         with nogil:
 *             result = self.scanner.ToTable()             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(GetResultValue(result))
*/
        __pyx_v_result = __pyx_v_self->scanner->ToTable();
      }

      /* "pyarrow/_dataset.pyx":3966
 *         cdef CResult[shared_ptr[CTable]] result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.ToTable()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":3969
 *             result = self.scanner.ToTable()
 * 
 *         return pyarrow_wrap_table(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     def take(self, object indices):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Table> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3969, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3953
 *         return TaggedRecordBatchIterator.wrap(self, move(iterator))
 * 
 *     def to_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a Scanner into a Table.
*/

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

/* "pyarrow/_dataset.pyx":3971
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def take(self, object indices):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_15take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_14take, "Scanner.take(self, indices)\n\nSelect rows of data by index.\n\nWill only consume as many batches of the underlying dataset as\nneeded. Otherwise, this is equivalent to\n``to_table().take(indices)``.\n\nParameters\n----------\nindices : Array or array-like\n    indices of rows to select in the dataset.\n\nReturns\n-------\nTable");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_15take = {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_15take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_14take};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_15take(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_indices = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3971, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "take", 0) < (0)) __PYX_ERR(0, 3971, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("take", 1, 1, 1, i); __PYX_ERR(0, 3971, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3971, __pyx_L3_error)
    }
    __pyx_v_indices = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3971, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_14take(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self), __pyx_v_indices);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_14take(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, PyObject *__pyx_v_indices) {
  arrow::Result<std::shared_ptr< arrow::Table> >  __pyx_v_result;
  std::shared_ptr< arrow::Array>  __pyx_v_c_indices;
  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;
  size_t __pyx_t_7;
  std::shared_ptr< arrow::Array>  __pyx_t_8;
  std::shared_ptr< arrow::Table>  __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take", 0);
  __Pyx_INCREF(__pyx_v_indices);

  /* "pyarrow/_dataset.pyx":3991
 *         cdef shared_ptr[CArray] c_indices
 * 
 *         if not isinstance(indices, pa.Array):             # <<<<<<<<<<<<<<
 *             indices = pa.array(indices)
 *         c_indices = pyarrow_unwrap_array(indices)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_indices, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 3991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "pyarrow/_dataset.pyx":3992
 * 
 *         if not isinstance(indices, pa.Array):
 *             indices = pa.array(indices)             # <<<<<<<<<<<<<<
 *         c_indices = pyarrow_unwrap_array(indices)
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pa); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_indices};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_dataset.pyx":3991
 *         cdef shared_ptr[CArray] c_indices
 * 
 *         if not isinstance(indices, pa.Array):             # <<<<<<<<<<<<<<
 *             indices = pa.array(indices)
 *         c_indices = pyarrow_unwrap_array(indices)
*/
  }

  /* "pyarrow/_dataset.pyx":3993
 *         if not isinstance(indices, pa.Array):
 *             indices = pa.array(indices)
 *         c_indices = pyarrow_unwrap_array(indices)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_8 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_array(__pyx_v_indices); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3993, __pyx_L1_error)
  __pyx_v_c_indices = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pyarrow/_dataset.pyx":3995
 *         c_indices = pyarrow_unwrap_array(indices)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.TakeRows(deref(c_indices))
 *         return pyarrow_wrap_table(GetResultValue(result))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":3996
 * 
 *         with nogil:
 *             result = self.scanner.TakeRows(deref(c_indices))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
*/
        __pyx_v_result = __pyx_v_self->scanner->TakeRows((*__pyx_v_c_indices));
      }

      /* "pyarrow/_dataset.pyx":3995
 *         c_indices = pyarrow_unwrap_array(indices)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.TakeRows(deref(c_indices))
 *         return pyarrow_wrap_table(GetResultValue(result))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_dataset.pyx":3997
 *         with nogil:
 *             result = self.scanner.TakeRows(deref(c_indices))
 *         return pyarrow_wrap_table(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     def head(self, int num_rows):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = arrow::py::GetResultValue<std::shared_ptr< arrow::Table> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3971
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def take(self, object indices):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/

  /* 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._dataset.Scanner.take", __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/_dataset.pyx":3999
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def head(self, int num_rows):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the dataset.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_17head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_16head, "Scanner.head(self, int num_rows)\n\nLoad the first N rows of the dataset.\n\nParameters\n----------\nnum_rows : int\n    The number of rows to load.\n\nReturns\n-------\nTable");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_17head = {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_17head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_16head};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_17head(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_num_rows;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("head (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_num_rows,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3999, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "head", 0) < (0)) __PYX_ERR(0, 3999, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("head", 1, 1, 1, i); __PYX_ERR(0, 3999, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3999, __pyx_L3_error)
    }
    __pyx_v_num_rows = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_num_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("head", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3999, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_16head(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self), __pyx_v_num_rows);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_16head(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, int __pyx_v_num_rows) {
  arrow::Result<std::shared_ptr< arrow::Table> >  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Table>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("head", 0);

  /* "pyarrow/_dataset.pyx":4013
 *         """
 *         cdef CResult[shared_ptr[CTable]] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.Head(num_rows)
 *         return pyarrow_wrap_table(GetResultValue(result))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":4014
 *         cdef CResult[shared_ptr[CTable]] result
 *         with nogil:
 *             result = self.scanner.Head(num_rows)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
*/
        __pyx_v_result = __pyx_v_self->scanner->Head(__pyx_v_num_rows);
      }

      /* "pyarrow/_dataset.pyx":4013
 *         """
 *         cdef CResult[shared_ptr[CTable]] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.Head(num_rows)
 *         return pyarrow_wrap_table(GetResultValue(result))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":4015
 *         with nogil:
 *             result = self.scanner.Head(num_rows)
 *         return pyarrow_wrap_table(GetResultValue(result))             # <<<<<<<<<<<<<<
 * 
 *     def count_rows(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::shared_ptr< arrow::Table> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4015, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":3999
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def head(self, int num_rows):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the dataset.
*/

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

/* "pyarrow/_dataset.pyx":4017
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def count_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_19count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_18count_rows, "Scanner.count_rows(self)\n\nCount rows matching the scanner filter.\n\nReturns\n-------\ncount : int");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_19count_rows = {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_19count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_18count_rows};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_19count_rows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count_rows (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("count_rows", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("count_rows", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_18count_rows(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_18count_rows(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  arrow::Result<int64_t>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count_rows", 0);

  /* "pyarrow/_dataset.pyx":4026
 *         """
 *         cdef CResult[int64_t] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.CountRows()
 *         return GetResultValue(result)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":4027
 *         cdef CResult[int64_t] result
 *         with nogil:
 *             result = self.scanner.CountRows()             # <<<<<<<<<<<<<<
 *         return GetResultValue(result)
 * 
*/
        __pyx_v_result = __pyx_v_self->scanner->CountRows();
      }

      /* "pyarrow/_dataset.pyx":4026
 *         """
 *         cdef CResult[int64_t] result
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.scanner.CountRows()
 *         return GetResultValue(result)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_dataset.pyx":4028
 *         with nogil:
 *             result = self.scanner.CountRows()
 *         return GetResultValue(result)             # <<<<<<<<<<<<<<
 * 
 *     def to_reader(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<int64_t>(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4028, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":4017
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def count_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/

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

/* "pyarrow/_dataset.pyx":4030
 *         return GetResultValue(result)
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Consume this scanner as a RecordBatchReader.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_21to_reader(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_20to_reader, "Scanner.to_reader(self)\n\nConsume this scanner as a RecordBatchReader.\n\nReturns\n-------\nRecordBatchReader");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_21to_reader = {"to_reader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_21to_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_20to_reader};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_21to_reader(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_reader (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("to_reader", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("to_reader", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_20to_reader(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_20to_reader(struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *__pyx_v_reader = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr< arrow::RecordBatchReader>  __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_reader", 0);

  /* "pyarrow/_dataset.pyx":4038
 *         """
 *         cdef RecordBatchReader reader
 *         reader = RecordBatchReader.__new__(RecordBatchReader)             # <<<<<<<<<<<<<<
 *         reader.reader = GetResultValue(self.scanner.ToRecordBatchReader())
 *         return reader
*/
  __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader), __pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader)))) __PYX_ERR(0, 4038, __pyx_L1_error)
  __pyx_v_reader = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4039
 *         cdef RecordBatchReader reader
 *         reader = RecordBatchReader.__new__(RecordBatchReader)
 *         reader.reader = GetResultValue(self.scanner.ToRecordBatchReader())             # <<<<<<<<<<<<<<
 *         return reader
 * 
*/
  __pyx_t_2 = arrow::py::GetResultValue<std::shared_ptr< arrow::RecordBatchReader> >(__pyx_v_self->scanner->ToRecordBatchReader()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L1_error)
  __pyx_v_reader->reader = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::py::SharedPtrNoGIL< arrow::RecordBatchReader> )__pyx_t_2));

  /* "pyarrow/_dataset.pyx":4040
 *         reader = RecordBatchReader.__new__(RecordBatchReader)
 *         reader.reader = GetResultValue(self.scanner.ToRecordBatchReader())
 *         return reader             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_reader);
  __pyx_r = ((PyObject *)__pyx_v_reader);
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":4030
 *         return GetResultValue(result)
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Consume this scanner as a RecordBatchReader.
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_22__reduce_cython__, "Scanner.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_23__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_22__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_23__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_22__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_scanner_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.__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.scanner,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_7Scanner_24__setstate_cython__, "Scanner.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_7Scanner_25__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_24__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_7Scanner_25__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.Scanner.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_7Scanner_24__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_7Scanner_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_scanner_self_wrapped_cannot, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":4043
 * 
 * 
 * def get_partition_keys(Expression partition_expression):             # <<<<<<<<<<<<<<
 *     """
 *     Extract partition keys (equality constraints between a field and a scalar)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_13get_partition_keys(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_12get_partition_keys, "get_partition_keys(Expression partition_expression)\n\nExtract partition keys (equality constraints between a field and a scalar)\nfrom an expression as a dict mapping the field's name to its value.\n\nNB: All expressions yielded by a HivePartitioning or DirectoryPartitioning\nwill be conjunctions of equality conditions and are accessible through this\nfunction. Other subexpressions will be ignored.\n\nParameters\n----------\npartition_expression : pyarrow.dataset.Expression\n\nReturns\n-------\ndict\n\nExamples\n--------\n\nFor example, an expression of\n<pyarrow.dataset.Expression ((part == A:string) and (year == 2016:int32))>\nis converted to {'part': 'A', 'year': 2016}");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_13get_partition_keys = {"get_partition_keys", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13get_partition_keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12get_partition_keys};
static PyObject *__pyx_pw_7pyarrow_8_dataset_13get_partition_keys(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_partition_keys (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_partition_expression,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4043, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4043, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_partition_keys", 0) < (0)) __PYX_ERR(0, 4043, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_partition_keys", 1, 1, 1, i); __PYX_ERR(0, 4043, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4043, __pyx_L3_error)
    }
    __pyx_v_partition_expression = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_partition_keys", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4043, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.get_partition_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_partition_expression), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression, 1, "partition_expression", 0))) __PYX_ERR(0, 4043, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_12get_partition_keys(__pyx_self, __pyx_v_partition_expression);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_12get_partition_keys(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_8_compute_Expression *__pyx_v_partition_expression) {
  arrow::compute::Expression __pyx_v_expr;
  std::pair< arrow::FieldRef, arrow::Datum>  __pyx_v_ref_val;
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  arrow::compute::Expression __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct arrow::compute::KnownFieldValues __pyx_t_3;
  std::unordered_map< arrow::FieldRef, arrow::Datum, arrow::FieldRef::Hash> ::iterator __pyx_t_4;
  std::unordered_map< arrow::FieldRef, arrow::Datum, arrow::FieldRef::Hash>  __pyx_t_5;
  std::pair< arrow::FieldRef, arrow::Datum>  __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_partition_keys", 0);

  /* "pyarrow/_dataset.pyx":4068
 *     """
 *     cdef:
 *         CExpression expr = partition_expression.unwrap()             # <<<<<<<<<<<<<<
 *         pair[CFieldRef, CDatum] ref_val
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_8_compute_Expression *)__pyx_v_partition_expression->__pyx_vtab)->unwrap(__pyx_v_partition_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4068, __pyx_L1_error)
  __pyx_v_expr = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":4071
 *         pair[CFieldRef, CDatum] ref_val
 * 
 *     out = {}             # <<<<<<<<<<<<<<
 *     for ref_val in GetResultValue(CExtractKnownFieldValues(expr)).map:
 *         assert ref_val.first.name() != nullptr
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_out = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4072
 * 
 *     out = {}
 *     for ref_val in GetResultValue(CExtractKnownFieldValues(expr)).map:             # <<<<<<<<<<<<<<
 *         assert ref_val.first.name() != nullptr
 *         assert ref_val.second.kind() == DatumType_SCALAR
*/
  __pyx_t_3 = arrow::py::GetResultValue<struct arrow::compute::KnownFieldValues>(arrow::compute::ExtractKnownFieldValues(__pyx_v_expr)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4072, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_3.map;
  __pyx_t_4 = __pyx_t_5.begin();
  for (; __pyx_t_4 != __pyx_t_5.end(); ++__pyx_t_4) {
    __pyx_t_6 = *__pyx_t_4;
    __pyx_v_ref_val = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "pyarrow/_dataset.pyx":4073
 *     out = {}
 *     for ref_val in GetResultValue(CExtractKnownFieldValues(expr)).map:
 *         assert ref_val.first.name() != nullptr             # <<<<<<<<<<<<<<
 *         assert ref_val.second.kind() == DatumType_SCALAR
 *         val = pyarrow_wrap_scalar(ref_val.second.scalar())
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_7 = (__pyx_v_ref_val.first.name() != nullptr);
      if (unlikely(!__pyx_t_7)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 4073, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 4073, __pyx_L1_error)
    #endif

    /* "pyarrow/_dataset.pyx":4074
 *     for ref_val in GetResultValue(CExtractKnownFieldValues(expr)).map:
 *         assert ref_val.first.name() != nullptr
 *         assert ref_val.second.kind() == DatumType_SCALAR             # <<<<<<<<<<<<<<
 *         val = pyarrow_wrap_scalar(ref_val.second.scalar())
 *         out[frombytes(deref(ref_val.first.name()))] = val.as_py()
*/
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_7 = (__pyx_v_ref_val.second.kind() ==  arrow::Datum::SCALAR);
      if (unlikely(!__pyx_t_7)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(0, 4074, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(0, 4074, __pyx_L1_error)
    #endif

    /* "pyarrow/_dataset.pyx":4075
 *         assert ref_val.first.name() != nullptr
 *         assert ref_val.second.kind() == DatumType_SCALAR
 *         val = pyarrow_wrap_scalar(ref_val.second.scalar())             # <<<<<<<<<<<<<<
 *         out[frombytes(deref(ref_val.first.name()))] = val.as_py()
 *     return out
*/
    __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar(__pyx_v_ref_val.second.scalar()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_dataset.pyx":4076
 *         assert ref_val.second.kind() == DatumType_SCALAR
 *         val = pyarrow_wrap_scalar(ref_val.second.scalar())
 *         out[frombytes(deref(ref_val.first.name()))] = val.as_py()             # <<<<<<<<<<<<<<
 *     return out
 * 
*/
    __pyx_t_8 = __pyx_v_val;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_as_py, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4076, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string((*__pyx_v_ref_val.first.name())); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4076, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    if (unlikely((PyDict_SetItem(__pyx_v_out, __pyx_t_8, __pyx_t_2) < 0))) __PYX_ERR(0, 4076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/_dataset.pyx":4072
 * 
 *     out = {}
 *     for ref_val in GetResultValue(CExtractKnownFieldValues(expr)).map:             # <<<<<<<<<<<<<<
 *         assert ref_val.first.name() != nullptr
 *         assert ref_val.second.kind() == DatumType_SCALAR
*/
  }

  /* "pyarrow/_dataset.pyx":4077
 *         val = pyarrow_wrap_scalar(ref_val.second.scalar())
 *         out[frombytes(deref(ref_val.first.name()))] = val.as_py()
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "pyarrow/_dataset.pyx":4043
 * 
 * 
 * def get_partition_keys(Expression partition_expression):             # <<<<<<<<<<<<<<
 *     """
 *     Extract partition keys (equality constraints between a field and a scalar)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pyarrow._dataset.get_partition_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":4095
 *     """
 * 
 *     def __init__(self, path, metadata, size):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.metadata = metadata
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_metadata = 0;
  PyObject *__pyx_v_size = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_path_2,&__pyx_mstate_global->__pyx_n_u_metadata,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4095, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4095, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4095, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4095, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 4095, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 4095, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4095, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4095, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4095, __pyx_L3_error)
    }
    __pyx_v_path = values[0];
    __pyx_v_metadata = values[1];
    __pyx_v_size = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 4095, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile___init__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self), __pyx_v_path, __pyx_v_metadata, __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile___init__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_path, PyObject *__pyx_v_metadata, PyObject *__pyx_v_size) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":4096
 * 
 *     def __init__(self, path, metadata, size):
 *         self.path = path             # <<<<<<<<<<<<<<
 *         self.metadata = metadata
 *         self.size = size
*/
  __pyx_t_1 = __pyx_v_path;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 4096, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4097
 *     def __init__(self, path, metadata, size):
 *         self.path = path
 *         self.metadata = metadata             # <<<<<<<<<<<<<<
 *         self.size = size
 * 
*/
  __Pyx_INCREF(__pyx_v_metadata);
  __Pyx_GIVEREF(__pyx_v_metadata);
  __Pyx_GOTREF(__pyx_v_self->metadata);
  __Pyx_DECREF(__pyx_v_self->metadata);
  __pyx_v_self->metadata = __pyx_v_metadata;

  /* "pyarrow/_dataset.pyx":4098
 *         self.path = path
 *         self.metadata = metadata
 *         self.size = size             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_As_int64_t(__pyx_v_size); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4098, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_2;

  /* "pyarrow/_dataset.pyx":4095
 *     """
 * 
 *     def __init__(self, path, metadata, size):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         self.metadata = metadata
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pxd":177
 * 
 *     # The full path to the created file
 *     cdef public str path             # <<<<<<<<<<<<<<
 *     # Optional Parquet metadata
 *     # This metadata will have the file path attribute set to the path of
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path___get__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 177, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.path.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_4__del__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4path_4__del__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = ((PyObject*)Py_None);

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

/* "pyarrow/_dataset.pxd":181
 *     # This metadata will have the file path attribute set to the path of
 *     # the written file.
 *     cdef public object metadata             # <<<<<<<<<<<<<<
 *     # The size of the file in bytes
 *     cdef public int64_t size
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata___get__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->metadata);
  __Pyx_DECREF(__pyx_v_self->metadata);
  __pyx_v_self->metadata = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_4__del__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_8metadata_4__del__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->metadata);
  __Pyx_DECREF(__pyx_v_self->metadata);
  __pyx_v_self->metadata = Py_None;

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

/* "pyarrow/_dataset.pxd":183
 *     cdef public object metadata
 *     # The size of the file in bytes
 *     cdef public int64_t size             # <<<<<<<<<<<<<<
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size___get__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size___get__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 183, __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._dataset.WrittenFile.size.__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_8_dataset_11WrittenFile_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size_2__set__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4size_2__set__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __pyx_t_1 = __Pyx_PyLong_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_1 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 183, __pyx_L1_error)
  __pyx_v_self->size = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__, "WrittenFile.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__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;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.metadata, self.path, self.size)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->metadata);
  __Pyx_GIVEREF(__pyx_v_self->metadata);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->metadata) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->path);
  __Pyx_GIVEREF(__pyx_v_self->path);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->path) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.metadata, self.path, self.size)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":7
 *     state = (self.metadata, self.path, self.size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

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

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.metadata is not None or self.path is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.metadata, self.path, self.size)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.metadata is not None or self.path is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, None), state
*/
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->metadata != Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->path != ((PyObject*)Py_None));
    __pyx_t_3 = __pyx_t_4;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.metadata is not None or self.path is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.metadata is not None or self.path is not None
 *     if use_setstate:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_WrittenFile); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_45017777);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_45017777);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_int_45017777) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.metadata is not None or self.path is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, None), state
 *     else:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_WrittenFile__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_WrittenFile); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_45017777);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_45017777);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_int_45017777) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 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_5);
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.__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_WrittenFile, (type(self), 0x2aeeab1, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_WrittenFile__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__, "WrittenFile.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_WrittenFile__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_8_dataset___pyx_unpickle_WrittenFile__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __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;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_WrittenFile__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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._dataset.WrittenFile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":4101
 * 
 * 
 * cdef void _filesystemdataset_write_visitor(             # <<<<<<<<<<<<<<
 *         dict visit_args,
 *         CFileWriter* file_writer):
*/

static void __pyx_f_7pyarrow_8_dataset__filesystemdataset_write_visitor(PyObject *__pyx_v_visit_args, arrow::dataset::FileWriter *__pyx_v_file_writer) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_base_dir = 0;
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v_written_file = 0;
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *__pyx_v_file_format = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_filesystemdataset_write_visitor", 0);

  /* "pyarrow/_dataset.pyx":4110
 *         FileFormat file_format
 * 
 *     path = frombytes(deref(file_writer).destination().path)             # <<<<<<<<<<<<<<
 *     base_dir = frombytes(visit_args['base_dir'])
 *     file_format = FileFormat.wrap(file_writer.format())
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string((*__pyx_v_file_writer).destination().path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 4110, __pyx_L1_error)
  __pyx_v_path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4111
 * 
 *     path = frombytes(deref(file_writer).destination().path)
 *     base_dir = frombytes(visit_args['base_dir'])             # <<<<<<<<<<<<<<
 *     file_format = FileFormat.wrap(file_writer.format())
 *     written_file = file_format._finish_write(path, base_dir, file_writer)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(__pyx_v_visit_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 4111, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_visit_args, __pyx_mstate_global->__pyx_n_u_base_dir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 4111, __pyx_L1_error)
  __pyx_v_base_dir = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4112
 *     path = frombytes(deref(file_writer).destination().path)
 *     base_dir = frombytes(visit_args['base_dir'])
 *     file_format = FileFormat.wrap(file_writer.format())             # <<<<<<<<<<<<<<
 *     written_file = file_format._finish_write(path, base_dir, file_writer)
 *     visit_args['file_visitor'](written_file)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_10FileFormat_wrap(__pyx_v_file_writer->format()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat))))) __PYX_ERR(0, 4112, __pyx_L1_error)
  __pyx_v_file_format = ((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4113
 *     base_dir = frombytes(visit_args['base_dir'])
 *     file_format = FileFormat.wrap(file_writer.format())
 *     written_file = file_format._finish_write(path, base_dir, file_writer)             # <<<<<<<<<<<<<<
 *     visit_args['file_visitor'](written_file)
 * 
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat *)__pyx_v_file_format->__pyx_vtab)->_finish_write(__pyx_v_file_format, __pyx_v_path, __pyx_v_base_dir, __pyx_v_file_writer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_written_file = ((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4114
 *     file_format = FileFormat.wrap(file_writer.format())
 *     written_file = file_format._finish_write(path, base_dir, file_writer)
 *     visit_args['file_visitor'](written_file)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = NULL;
  if (unlikely(__pyx_v_visit_args == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 4114, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_visit_args, __pyx_mstate_global->__pyx_n_u_file_visitor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_written_file)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __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(0, 4114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4101
 * 
 * 
 * cdef void _filesystemdataset_write_visitor(             # <<<<<<<<<<<<<<
 *         dict visit_args,
 *         CFileWriter* file_writer):
*/

  /* 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_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._dataset._filesystemdataset_write_visitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_base_dir);
  __Pyx_XDECREF((PyObject *)__pyx_v_written_file);
  __Pyx_XDECREF((PyObject *)__pyx_v_file_format);
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/_dataset.pyx":4117
 * 
 * 
 * def _filesystemdataset_write(             # <<<<<<<<<<<<<<
 *     Scanner data not None,
 *     object base_dir not None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_15_filesystemdataset_write(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_14_filesystemdataset_write, "_filesystemdataset_write(Scanner data, base_dir, str basename_template, FileSystem filesystem, Partitioning partitioning, bool preserve_order, FileWriteOptions file_options, int max_partitions, file_visitor, str existing_data_behavior, int max_open_files, int max_rows_per_file, int min_rows_per_group, int max_rows_per_group, bool create_dir)\n\nCFileSystemDataset.Write wrapper");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_15_filesystemdataset_write = {"_filesystemdataset_write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15_filesystemdataset_write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14_filesystemdataset_write};
static PyObject *__pyx_pw_7pyarrow_8_dataset_15_filesystemdataset_write(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_data = 0;
  PyObject *__pyx_v_base_dir = 0;
  PyObject *__pyx_v_basename_template = 0;
  struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem = 0;
  struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_partitioning = 0;
  bool __pyx_v_preserve_order;
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_file_options = 0;
  int __pyx_v_max_partitions;
  PyObject *__pyx_v_file_visitor = 0;
  PyObject *__pyx_v_existing_data_behavior = 0;
  int __pyx_v_max_open_files;
  int __pyx_v_max_rows_per_file;
  int __pyx_v_min_rows_per_group;
  int __pyx_v_max_rows_per_group;
  bool __pyx_v_create_dir;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_filesystemdataset_write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_base_dir,&__pyx_mstate_global->__pyx_n_u_basename_template,&__pyx_mstate_global->__pyx_n_u_filesystem,&__pyx_mstate_global->__pyx_n_u_partitioning,&__pyx_mstate_global->__pyx_n_u_preserve_order,&__pyx_mstate_global->__pyx_n_u_file_options,&__pyx_mstate_global->__pyx_n_u_max_partitions,&__pyx_mstate_global->__pyx_n_u_file_visitor,&__pyx_mstate_global->__pyx_n_u_existing_data_behavior,&__pyx_mstate_global->__pyx_n_u_max_open_files,&__pyx_mstate_global->__pyx_n_u_max_rows_per_file,&__pyx_mstate_global->__pyx_n_u_min_rows_per_group,&__pyx_mstate_global->__pyx_n_u_max_rows_per_group,&__pyx_mstate_global->__pyx_n_u_create_dir,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4117, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4117, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_filesystemdataset_write", 0) < (0)) __PYX_ERR(0, 4117, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 15; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_filesystemdataset_write", 1, 15, 15, i); __PYX_ERR(0, 4117, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 15)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 4117, __pyx_L3_error)
      values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 4117, __pyx_L3_error)
    }
    __pyx_v_data = ((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)values[0]);
    __pyx_v_base_dir = values[1];
    __pyx_v_basename_template = ((PyObject*)values[2]);
    __pyx_v_filesystem = ((struct __pyx_obj_7pyarrow_3_fs_FileSystem *)values[3]);
    __pyx_v_partitioning = ((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)values[4]);
    __pyx_v_preserve_order = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_preserve_order == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4123, __pyx_L3_error)
    __pyx_v_file_options = ((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)values[6]);
    __pyx_v_max_partitions = __Pyx_PyLong_As_int(values[7]); if (unlikely((__pyx_v_max_partitions == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4125, __pyx_L3_error)
    __pyx_v_file_visitor = values[8];
    __pyx_v_existing_data_behavior = ((PyObject*)values[9]);
    __pyx_v_max_open_files = __Pyx_PyLong_As_int(values[10]); if (unlikely((__pyx_v_max_open_files == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4128, __pyx_L3_error)
    __pyx_v_max_rows_per_file = __Pyx_PyLong_As_int(values[11]); if (unlikely((__pyx_v_max_rows_per_file == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4129, __pyx_L3_error)
    __pyx_v_min_rows_per_group = __Pyx_PyLong_As_int(values[12]); if (unlikely((__pyx_v_min_rows_per_group == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4130, __pyx_L3_error)
    __pyx_v_max_rows_per_group = __Pyx_PyLong_As_int(values[13]); if (unlikely((__pyx_v_max_rows_per_group == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4131, __pyx_L3_error)
    __pyx_v_create_dir = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_create_dir == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4132, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_filesystemdataset_write", 1, 15, 15, __pyx_nargs); __PYX_ERR(0, 4117, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset._filesystemdataset_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, 0, "data", 0))) __PYX_ERR(0, 4118, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_base_dir) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "base_dir"); __PYX_ERR(0, 4119, __pyx_L1_error)
  }
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_basename_template), (&PyUnicode_Type), 0, "basename_template", 1))) __PYX_ERR(0, 4120, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filesystem), __pyx_mstate_global->__pyx_ptype_7pyarrow_3_fs_FileSystem, 0, "filesystem", 0))) __PYX_ERR(0, 4121, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_partitioning), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning, 0, "partitioning", 0))) __PYX_ERR(0, 4122, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions, 0, "file_options", 0))) __PYX_ERR(0, 4124, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_existing_data_behavior), (&PyUnicode_Type), 0, "existing_data_behavior", 1))) __PYX_ERR(0, 4127, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_14_filesystemdataset_write(__pyx_self, __pyx_v_data, __pyx_v_base_dir, __pyx_v_basename_template, __pyx_v_filesystem, __pyx_v_partitioning, __pyx_v_preserve_order, __pyx_v_file_options, __pyx_v_max_partitions, __pyx_v_file_visitor, __pyx_v_existing_data_behavior, __pyx_v_max_open_files, __pyx_v_max_rows_per_file, __pyx_v_min_rows_per_group, __pyx_v_max_rows_per_group, __pyx_v_create_dir);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_14_filesystemdataset_write(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_8_dataset_Scanner *__pyx_v_data, PyObject *__pyx_v_base_dir, PyObject *__pyx_v_basename_template, struct __pyx_obj_7pyarrow_3_fs_FileSystem *__pyx_v_filesystem, struct __pyx_obj_7pyarrow_8_dataset_Partitioning *__pyx_v_partitioning, bool __pyx_v_preserve_order, struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *__pyx_v_file_options, int __pyx_v_max_partitions, PyObject *__pyx_v_file_visitor, PyObject *__pyx_v_existing_data_behavior, int __pyx_v_max_open_files, int __pyx_v_max_rows_per_file, int __pyx_v_min_rows_per_group, int __pyx_v_max_rows_per_group, bool __pyx_v_create_dir) {
  arrow::dataset::FileSystemDatasetWriteOptions __pyx_v_c_options;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_v_c_scanner;
  PyObject *__pyx_v_visit_args = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::dataset::FileWriteOptions>  __pyx_t_1;
  std::shared_ptr<arrow::fs::FileSystem>  __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;
  size_t __pyx_t_9;
  std::string __pyx_t_10;
  std::shared_ptr<arrow::dataset::Partitioning>  __pyx_t_11;
  int __pyx_t_12;
  std::shared_ptr<arrow::dataset::Scanner>  __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_filesystemdataset_write", 0);

  /* "pyarrow/_dataset.pyx":4142
 *         dict visit_args
 * 
 *     c_options.file_write_options = file_options.unwrap()             # <<<<<<<<<<<<<<
 *     c_options.filesystem = filesystem.unwrap()
 *     c_options.base_dir = tobytes(_stringify_path(base_dir))
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_16FileWriteOptions_unwrap(__pyx_v_file_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4142, __pyx_L1_error)
  __pyx_v_c_options.file_write_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":4143
 * 
 *     c_options.file_write_options = file_options.unwrap()
 *     c_options.filesystem = filesystem.unwrap()             # <<<<<<<<<<<<<<
 *     c_options.base_dir = tobytes(_stringify_path(base_dir))
 *     c_options.partitioning = partitioning.unwrap()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem *)__pyx_v_filesystem->__pyx_vtab)->unwrap(__pyx_v_filesystem); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L1_error)
  __pyx_v_c_options.filesystem = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":4144
 *     c_options.file_write_options = file_options.unwrap()
 *     c_options.filesystem = filesystem.unwrap()
 *     c_options.base_dir = tobytes(_stringify_path(base_dir))             # <<<<<<<<<<<<<<
 *     c_options.partitioning = partitioning.unwrap()
 *     c_options.preserve_order = preserve_order
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_stringify_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_base_dir};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c_options.base_dir = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":4145
 *     c_options.filesystem = filesystem.unwrap()
 *     c_options.base_dir = tobytes(_stringify_path(base_dir))
 *     c_options.partitioning = partitioning.unwrap()             # <<<<<<<<<<<<<<
 *     c_options.preserve_order = preserve_order
 *     c_options.max_partitions = max_partitions
*/
  __pyx_t_11 = __pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap(__pyx_v_partitioning); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4145, __pyx_L1_error)
  __pyx_v_c_options.partitioning = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

  /* "pyarrow/_dataset.pyx":4146
 *     c_options.base_dir = tobytes(_stringify_path(base_dir))
 *     c_options.partitioning = partitioning.unwrap()
 *     c_options.preserve_order = preserve_order             # <<<<<<<<<<<<<<
 *     c_options.max_partitions = max_partitions
 *     c_options.max_open_files = max_open_files
*/
  __pyx_v_c_options.preserve_order = __pyx_v_preserve_order;

  /* "pyarrow/_dataset.pyx":4147
 *     c_options.partitioning = partitioning.unwrap()
 *     c_options.preserve_order = preserve_order
 *     c_options.max_partitions = max_partitions             # <<<<<<<<<<<<<<
 *     c_options.max_open_files = max_open_files
 *     c_options.max_rows_per_file = max_rows_per_file
*/
  __pyx_v_c_options.max_partitions = __pyx_v_max_partitions;

  /* "pyarrow/_dataset.pyx":4148
 *     c_options.preserve_order = preserve_order
 *     c_options.max_partitions = max_partitions
 *     c_options.max_open_files = max_open_files             # <<<<<<<<<<<<<<
 *     c_options.max_rows_per_file = max_rows_per_file
 *     c_options.max_rows_per_group = max_rows_per_group
*/
  __pyx_v_c_options.max_open_files = __pyx_v_max_open_files;

  /* "pyarrow/_dataset.pyx":4149
 *     c_options.max_partitions = max_partitions
 *     c_options.max_open_files = max_open_files
 *     c_options.max_rows_per_file = max_rows_per_file             # <<<<<<<<<<<<<<
 *     c_options.max_rows_per_group = max_rows_per_group
 *     c_options.min_rows_per_group = min_rows_per_group
*/
  __pyx_v_c_options.max_rows_per_file = __pyx_v_max_rows_per_file;

  /* "pyarrow/_dataset.pyx":4150
 *     c_options.max_open_files = max_open_files
 *     c_options.max_rows_per_file = max_rows_per_file
 *     c_options.max_rows_per_group = max_rows_per_group             # <<<<<<<<<<<<<<
 *     c_options.min_rows_per_group = min_rows_per_group
 *     c_options.basename_template = tobytes(basename_template)
*/
  __pyx_v_c_options.max_rows_per_group = __pyx_v_max_rows_per_group;

  /* "pyarrow/_dataset.pyx":4151
 *     c_options.max_rows_per_file = max_rows_per_file
 *     c_options.max_rows_per_group = max_rows_per_group
 *     c_options.min_rows_per_group = min_rows_per_group             # <<<<<<<<<<<<<<
 *     c_options.basename_template = tobytes(basename_template)
 *     if existing_data_behavior == 'error':
*/
  __pyx_v_c_options.min_rows_per_group = __pyx_v_min_rows_per_group;

  /* "pyarrow/_dataset.pyx":4152
 *     c_options.max_rows_per_group = max_rows_per_group
 *     c_options.min_rows_per_group = min_rows_per_group
 *     c_options.basename_template = tobytes(basename_template)             # <<<<<<<<<<<<<<
 *     if existing_data_behavior == 'error':
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_basename_template};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_c_options.basename_template = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":4153
 *     c_options.min_rows_per_group = min_rows_per_group
 *     c_options.basename_template = tobytes(basename_template)
 *     if existing_data_behavior == 'error':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
 *     elif existing_data_behavior == 'overwrite_or_ignore':
*/
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_existing_data_behavior, __pyx_mstate_global->__pyx_n_u_error, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 4153, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "pyarrow/_dataset.pyx":4154
 *     c_options.basename_template = tobytes(basename_template)
 *     if existing_data_behavior == 'error':
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR             # <<<<<<<<<<<<<<
 *     elif existing_data_behavior == 'overwrite_or_ignore':
 *         c_options.existing_data_behavior =\
*/
    __pyx_v_c_options.existing_data_behavior =              arrow::dataset::ExistingDataBehavior::kError;

    /* "pyarrow/_dataset.pyx":4153
 *     c_options.min_rows_per_group = min_rows_per_group
 *     c_options.basename_template = tobytes(basename_template)
 *     if existing_data_behavior == 'error':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
 *     elif existing_data_behavior == 'overwrite_or_ignore':
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":4155
 *     if existing_data_behavior == 'error':
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
 *     elif existing_data_behavior == 'overwrite_or_ignore':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior =\
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
*/
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_existing_data_behavior, __pyx_mstate_global->__pyx_n_u_overwrite_or_ignore, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 4155, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "pyarrow/_dataset.pyx":4156
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
 *     elif existing_data_behavior == 'overwrite_or_ignore':
 *         c_options.existing_data_behavior =\             # <<<<<<<<<<<<<<
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
 *     elif existing_data_behavior == 'delete_matching':
*/
    __pyx_v_c_options.existing_data_behavior =              arrow::dataset::ExistingDataBehavior::kOverwriteOrIgnore;

    /* "pyarrow/_dataset.pyx":4155
 *     if existing_data_behavior == 'error':
 *         c_options.existing_data_behavior = ExistingDataBehavior_ERROR
 *     elif existing_data_behavior == 'overwrite_or_ignore':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior =\
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":4158
 *         c_options.existing_data_behavior =\
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
 *     elif existing_data_behavior == 'delete_matching':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior = ExistingDataBehavior_DELETE_MATCHING
 *     else:
*/
  __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_existing_data_behavior, __pyx_mstate_global->__pyx_n_u_delete_matching, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 4158, __pyx_L1_error)
  if (likely(__pyx_t_12)) {

    /* "pyarrow/_dataset.pyx":4159
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
 *     elif existing_data_behavior == 'delete_matching':
 *         c_options.existing_data_behavior = ExistingDataBehavior_DELETE_MATCHING             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError(
*/
    __pyx_v_c_options.existing_data_behavior =              arrow::dataset::ExistingDataBehavior::kDeleteMatchingPartitions;

    /* "pyarrow/_dataset.pyx":4158
 *         c_options.existing_data_behavior =\
 *             ExistingDataBehavior_OVERWRITE_OR_IGNORE
 *     elif existing_data_behavior == 'delete_matching':             # <<<<<<<<<<<<<<
 *         c_options.existing_data_behavior = ExistingDataBehavior_DELETE_MATCHING
 *     else:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_dataset.pyx":4161
 *         c_options.existing_data_behavior = ExistingDataBehavior_DELETE_MATCHING
 *     else:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             ("existing_data_behavior must be one of 'error', ",
 *              "'overwrite_or_ignore' or 'delete_matching'")
*/
  /*else*/ {
    __pyx_t_6 = NULL;

    /* "pyarrow/_dataset.pyx":4162
 *     else:
 *         raise ValueError(
 *             ("existing_data_behavior must be one of 'error', ",             # <<<<<<<<<<<<<<
 *              "'overwrite_or_ignore' or 'delete_matching'")
 *         )
*/
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_tuple[0]};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4161, __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(0, 4161, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_dataset.pyx":4165
 *              "'overwrite_or_ignore' or 'delete_matching'")
 *         )
 *     c_options.create_dir = create_dir             # <<<<<<<<<<<<<<
 * 
 *     if file_visitor is not None:
*/
  __pyx_v_c_options.create_dir = __pyx_v_create_dir;

  /* "pyarrow/_dataset.pyx":4167
 *     c_options.create_dir = create_dir
 * 
 *     if file_visitor is not None:             # <<<<<<<<<<<<<<
 *         visit_args = {'base_dir': c_options.base_dir,
 *                       'file_visitor': file_visitor}
*/
  __pyx_t_12 = (__pyx_v_file_visitor != Py_None);
  if (__pyx_t_12) {

    /* "pyarrow/_dataset.pyx":4168
 * 
 *     if file_visitor is not None:
 *         visit_args = {'base_dir': c_options.base_dir,             # <<<<<<<<<<<<<<
 *                       'file_visitor': file_visitor}
 *         # Need to use post_finish because parquet metadata is not available
*/
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_c_options.base_dir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_base_dir, __pyx_t_6) < (0)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/_dataset.pyx":4169
 *     if file_visitor is not None:
 *         visit_args = {'base_dir': c_options.base_dir,
 *                       'file_visitor': file_visitor}             # <<<<<<<<<<<<<<
 *         # Need to use post_finish because parquet metadata is not available
 *         # until after Finish has been called
*/
    if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_file_visitor, __pyx_v_file_visitor) < (0)) __PYX_ERR(0, 4168, __pyx_L1_error)
    __pyx_v_visit_args = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_dataset.pyx":4172
 *         # Need to use post_finish because parquet metadata is not available
 *         # until after Finish has been called
 *         c_options.writer_post_finish = BindFunction[cb_writer_finish_internal](             # <<<<<<<<<<<<<<
 *             &_filesystemdataset_write_visitor, visit_args)
 * 
*/
    __pyx_v_c_options.writer_post_finish = arrow::py::BindFunction<__pyx_t_7pyarrow_8includes_16libarrow_dataset_cb_writer_finish_internal>((&__pyx_f_7pyarrow_8_dataset__filesystemdataset_write_visitor), __pyx_v_visit_args);

    /* "pyarrow/_dataset.pyx":4167
 *     c_options.create_dir = create_dir
 * 
 *     if file_visitor is not None:             # <<<<<<<<<<<<<<
 *         visit_args = {'base_dir': c_options.base_dir,
 *                       'file_visitor': file_visitor}
*/
  }

  /* "pyarrow/_dataset.pyx":4175
 *             &_filesystemdataset_write_visitor, visit_args)
 * 
 *     c_scanner = data.unwrap()             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(CFileSystemDataset.Write(c_options, c_scanner))
*/
  __pyx_t_13 = __pyx_f_7pyarrow_8_dataset_7Scanner_unwrap(__pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4175, __pyx_L1_error)
  __pyx_v_c_scanner = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13);

  /* "pyarrow/_dataset.pyx":4176
 * 
 *     c_scanner = data.unwrap()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CFileSystemDataset.Write(c_options, c_scanner))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_dataset.pyx":4177
 *     c_scanner = data.unwrap()
 *     with nogil:
 *         check_status(CFileSystemDataset.Write(c_options, c_scanner))             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_14 = __pyx_f_7pyarrow_3lib_check_status(arrow::dataset::FileSystemDataset::Write(__pyx_v_c_options, __pyx_v_c_scanner)); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 4177, __pyx_L6_error)
      }

      /* "pyarrow/_dataset.pyx":4176
 * 
 *     c_scanner = data.unwrap()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CFileSystemDataset.Write(c_options, c_scanner))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/_dataset.pyx":4117
 * 
 * 
 * def _filesystemdataset_write(             # <<<<<<<<<<<<<<
 *     Scanner data not None,
 *     object base_dir not None,
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._dataset._filesystemdataset_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_visit_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_dataset.pyx":4182
 * cdef class _ScanNodeOptions(ExecNodeOptions):
 * 
 *     def _set_options(self, Dataset dataset, dict scan_options):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CScanOptions] c_scan_options
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions__set_options, "_ScanNodeOptions._set_options(self, Dataset dataset, dict scan_options)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options = {"_set_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions__set_options};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset = 0;
  PyObject *__pyx_v_scan_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_options (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dataset,&__pyx_mstate_global->__pyx_n_u_scan_options_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4182, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_set_options", 0) < (0)) __PYX_ERR(0, 4182, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_set_options", 1, 2, 2, i); __PYX_ERR(0, 4182, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4182, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4182, __pyx_L3_error)
    }
    __pyx_v_dataset = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)values[0]);
    __pyx_v_scan_options = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_options", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4182, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset._ScanNodeOptions._set_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dataset), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, 1, "dataset", 0))) __PYX_ERR(0, 4182, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scan_options), (&PyDict_Type), 1, "scan_options", 1))) __PYX_ERR(0, 4182, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions__set_options(((struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *)__pyx_v_self), __pyx_v_dataset, __pyx_v_scan_options);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions__set_options(struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_scan_options) {
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_v_c_scan_options;
  int __pyx_v_require_sequenced_output;
  int __pyx_v_implicit_ordering;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr<arrow::dataset::ScanOptions>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  std::shared_ptr<arrow::dataset::Dataset>  __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_options", 0);

  /* "pyarrow/_dataset.pyx":4185
 *         cdef:
 *             shared_ptr[CScanOptions] c_scan_options
 *             bint require_sequenced_output=False             # <<<<<<<<<<<<<<
 *             bint implicit_ordering=False
 * 
*/
  __pyx_v_require_sequenced_output = 0;

  /* "pyarrow/_dataset.pyx":4186
 *             shared_ptr[CScanOptions] c_scan_options
 *             bint require_sequenced_output=False
 *             bint implicit_ordering=False             # <<<<<<<<<<<<<<
 * 
 *         c_scan_options = Scanner._make_scan_options(dataset, scan_options)
*/
  __pyx_v_implicit_ordering = 0;

  /* "pyarrow/_dataset.pyx":4188
 *             bint implicit_ordering=False
 * 
 *         c_scan_options = Scanner._make_scan_options(dataset, scan_options)             # <<<<<<<<<<<<<<
 * 
 *         require_sequenced_output=scan_options.get("require_sequenced_output", False)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_8_dataset_7Scanner__make_scan_options(__pyx_v_dataset, __pyx_v_scan_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4188, __pyx_L1_error)
  __pyx_v_c_scan_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_dataset.pyx":4190
 *         c_scan_options = Scanner._make_scan_options(dataset, scan_options)
 * 
 *         require_sequenced_output=scan_options.get("require_sequenced_output", False)             # <<<<<<<<<<<<<<
 *         implicit_ordering=scan_options.get("implicit_ordering", False)
 * 
*/
  if (unlikely(__pyx_v_scan_options == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 4190, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_scan_options, __pyx_mstate_global->__pyx_n_u_require_sequenced_output, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_require_sequenced_output = __pyx_t_3;

  /* "pyarrow/_dataset.pyx":4191
 * 
 *         require_sequenced_output=scan_options.get("require_sequenced_output", False)
 *         implicit_ordering=scan_options.get("implicit_ordering", False)             # <<<<<<<<<<<<<<
 * 
 *         self.wrapped.reset(
*/
  if (unlikely(__pyx_v_scan_options == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(0, 4191, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_scan_options, __pyx_mstate_global->__pyx_n_u_implicit_ordering, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 4191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_implicit_ordering = __pyx_t_3;

  /* "pyarrow/_dataset.pyx":4194
 * 
 *         self.wrapped.reset(
 *             new CScanNodeOptions(dataset.unwrap(), c_scan_options, require_sequenced_output, implicit_ordering)             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset *)__pyx_v_dataset->__pyx_vtab)->unwrap(__pyx_v_dataset); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":4193
 *         implicit_ordering=scan_options.get("implicit_ordering", False)
 * 
 *         self.wrapped.reset(             # <<<<<<<<<<<<<<
 *             new CScanNodeOptions(dataset.unwrap(), c_scan_options, require_sequenced_output, implicit_ordering)
 *         )
*/
  __pyx_v_self->__pyx_base.wrapped.reset(new arrow::dataset::ScanNodeOptions(__pyx_t_4, __pyx_v_c_scan_options, __pyx_v_require_sequenced_output, __pyx_v_implicit_ordering));

  /* "pyarrow/_dataset.pyx":4182
 * cdef class _ScanNodeOptions(ExecNodeOptions):
 * 
 *     def _set_options(self, Dataset dataset, dict scan_options):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CScanOptions] c_scan_options
*/

  /* 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._dataset._ScanNodeOptions._set_options", __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.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__, "_ScanNodeOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__(((struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_wrapped_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._dataset._ScanNodeOptions.__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.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__, "_ScanNodeOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset._ScanNodeOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__(((struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_wrapped_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_dataset.pyx":4227
 *     """
 * 
 *     def __init__(self, Dataset dataset, **kwargs):             # <<<<<<<<<<<<<<
 *         self._set_options(dataset, kwargs)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_15ScanNodeOptions_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_15ScanNodeOptions___init__, "ScanNodeOptions.__init__(self, Dataset dataset, **kwargs)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_15ScanNodeOptions_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15ScanNodeOptions_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_15ScanNodeOptions___init__};
static PyObject *__pyx_pw_7pyarrow_8_dataset_15ScanNodeOptions_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_dataset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4227, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4227, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "__init__", 1) < (0)) __PYX_ERR(0, 4227, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 4227, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4227, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4227, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_dataset = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4227, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow._dataset.ScanNodeOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dataset), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, 1, "dataset", 0))) __PYX_ERR(0, 4227, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_15ScanNodeOptions___init__(__pyx_self, __pyx_v_self, __pyx_v_dataset, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_15ScanNodeOptions___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyarrow_8_dataset_Dataset *__pyx_v_dataset, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_dataset.pyx":4228
 * 
 *     def __init__(self, Dataset dataset, **kwargs):
 *         self._set_options(dataset, kwargs)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __pyx_v_self;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_dataset), __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_options, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_dataset.pyx":4227
 *     """
 * 
 *     def __init__(self, Dataset dataset, **kwargs):             # <<<<<<<<<<<<<<
 *         self._set_options(dataset, kwargs)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_WrittenFile(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_8_dataset_17__pyx_unpickle_WrittenFile(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_8_dataset_16__pyx_unpickle_WrittenFile, "__pyx_unpickle_WrittenFile(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_8_dataset_17__pyx_unpickle_WrittenFile = {"__pyx_unpickle_WrittenFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_17__pyx_unpickle_WrittenFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16__pyx_unpickle_WrittenFile};
static PyObject *__pyx_pw_7pyarrow_8_dataset_17__pyx_unpickle_WrittenFile(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_WrittenFile (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_WrittenFile", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_WrittenFile", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_WrittenFile", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pyarrow._dataset.__pyx_unpickle_WrittenFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_8_dataset_16__pyx_unpickle_WrittenFile(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_8_dataset_16__pyx_unpickle_WrittenFile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_WrittenFile", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_WrittenFile(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')             # <<<<<<<<<<<<<<
 *     __pyx_result = WrittenFile.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, __pyx_k_metadata_path_size); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
 *     __pyx_result = WrittenFile.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_WrittenFile);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
 *     __pyx_result = WrittenFile.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = WrittenFile.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_8_dataset___pyx_unpickle_WrittenFile__set_state(((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
 *     __pyx_result = WrittenFile.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):
 *     __pyx_result.metadata = __pyx_state[0]; __pyx_result.path = __pyx_state[1]; __pyx_result.size = __pyx_state[2]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_WrittenFile(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._dataset.__pyx_unpickle_WrittenFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.metadata = __pyx_state[0]; __pyx_result.path = __pyx_state[1]; __pyx_result.size = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/

static PyObject *__pyx_f_7pyarrow_8_dataset___pyx_unpickle_WrittenFile__set_state(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_WrittenFile__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):
 *     __pyx_result.metadata = __pyx_state[0]; __pyx_result.path = __pyx_state[1]; __pyx_result.size = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->metadata);
  __Pyx_DECREF(__pyx_v___pyx_result->metadata);
  __pyx_v___pyx_result->metadata = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->path);
  __Pyx_DECREF(__pyx_v___pyx_result->path);
  __pyx_v___pyx_result->path = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->size = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):
 *     __pyx_result.metadata = __pyx_state[0]; __pyx_result.path = __pyx_state[1]; __pyx_result.size = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)             # <<<<<<<<<<<<<<
*/
  __pyx_t_3 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 3); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_WrittenFile__set_state(<WrittenFile> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_WrittenFile__set_state(WrittenFile __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.metadata = __pyx_state[0]; __pyx_result.path = __pyx_state[1]; __pyx_result.size = __pyx_state[2]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 3)
*/

  /* 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._dataset.__pyx_unpickle_WrittenFile__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory __pyx_vtable_7pyarrow_8_dataset_DatasetFactory;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_DatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *p = (struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_14DatasetFactory_root_partition(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_14DatasetFactory_root_partition(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_14root_partition_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_DatasetFactory[] = {
  {"inspect_schemas", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_2inspect_schemas},
  {"inspect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_5inspect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_4inspect},
  {"finish", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_7finish, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_6finish},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14DatasetFactory_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_DatasetFactory[] = {
  {"root_partition", __pyx_getprop_7pyarrow_8_dataset_14DatasetFactory_root_partition, __pyx_setprop_7pyarrow_8_dataset_14DatasetFactory_root_partition, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_DatasetFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory},
  {Py_tp_doc, (void *)PyDoc_STR("DatasetFactory()\n\nDatasetFactory is used to create a Dataset, inspect the Schema\nof the fragments contained in it, and declare a partitioning.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_DatasetFactory},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_DatasetFactory},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_14DatasetFactory_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_DatasetFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_DatasetFactory_spec = {
  "pyarrow._dataset.DatasetFactory",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_DatasetFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_DatasetFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""DatasetFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("DatasetFactory()\n\nDatasetFactory is used to create a Dataset, inspect the Schema\nof the fragments contained in it, and declare a partitioning."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_DatasetFactory, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_DatasetFactory, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_14DatasetFactory_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_DatasetFactory, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset __pyx_vtable_7pyarrow_8_dataset_Dataset;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Dataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_Dataset *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_Dataset;
  __Pyx_default_placement_construct(&(p->wrapped));
  p->_scan_options = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *p = (struct __pyx_obj_7pyarrow_8_dataset_Dataset *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->wrapped);
  Py_CLEAR(p->_scan_options);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_Dataset(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *p = (struct __pyx_obj_7pyarrow_8_dataset_Dataset *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_Dataset); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_scan_options) {
    e = (*v)(p->_scan_options, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_Dataset(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_Dataset *p = (struct __pyx_obj_7pyarrow_8_dataset_Dataset *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_Dataset); }
  tmp = ((PyObject*)p->_scan_options);
  p->_scan_options = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_7Dataset_partition_expression(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_7Dataset_20partition_expression_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_7Dataset_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_7Dataset_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_7Dataset__scan_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_7Dataset__scan_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_3__set__(o, v);
  }
  else {
    return __pyx_pw_7pyarrow_8_dataset_7Dataset_13_scan_options_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_Dataset[] = {
  {"replace_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_3replace_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_2replace_schema},
  {"get_fragments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_5get_fragments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_4get_fragments},
  {"_get_fragments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_7_get_fragments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_6_get_fragments},
  {"_scanner_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_10_scanner_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_9_scanner_options},
  {"scanner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_12scanner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_11scanner},
  {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_14to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_13to_batches},
  {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_16to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_15to_table},
  {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_18take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_17take},
  {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_20head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_19head},
  {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_22count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_21count_rows},
  {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_24filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_23filter},
  {"sort_by", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_26sort_by, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_25sort_by},
  {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_28join, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_27join},
  {"join_asof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_30join_asof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_29join_asof},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_32__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_31__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Dataset_34__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Dataset_33__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_Dataset[] = {
  {"partition_expression", __pyx_getprop_7pyarrow_8_dataset_7Dataset_partition_expression, 0, PyDoc_STR("\n        An Expression which evaluates to true for all data viewed by this\n        Dataset.\n        "), 0},
  {"schema", __pyx_getprop_7pyarrow_8_dataset_7Dataset_schema, 0, PyDoc_STR("The common schema of the full Dataset"), 0},
  {"_scan_options", __pyx_getprop_7pyarrow_8_dataset_7Dataset__scan_options, __pyx_setprop_7pyarrow_8_dataset_7Dataset__scan_options, PyDoc_STR("_scan_options: dict"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_Dataset_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Dataset},
  {Py_tp_doc, (void *)PyDoc_STR("Dataset()\n\nCollection of data fragments and potentially child datasets.\n\nArrow Datasets allow you to query against data that has been split across\nmultiple files. This sharding of data may indicate partitioning, which\ncan accelerate queries that only touch some partitions (files).")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_Dataset},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_Dataset},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_Dataset},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_Dataset},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_7Dataset_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_Dataset},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_Dataset_spec = {
  "pyarrow._dataset.Dataset",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Dataset),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_Dataset_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_Dataset = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""Dataset", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Dataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Dataset()\n\nCollection of data fragments and potentially child datasets.\n\nArrow Datasets allow you to query against data that has been split across\nmultiple files. This sharding of data may indicate partitioning, which\ncan accelerate queries that only touch some partitions (files)."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_Dataset, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_Dataset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_Dataset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_7Dataset_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_Dataset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Scanner __pyx_vtable_7pyarrow_8_dataset_Scanner;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Scanner(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_Scanner *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_Scanner *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_Scanner;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_Scanner(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_Scanner *p = (struct __pyx_obj_7pyarrow_8_dataset_Scanner *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_Scanner) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_Scanner);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_7Scanner_dataset_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_7Scanner_14dataset_schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_7Scanner_projected_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_7Scanner_16projected_schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_Scanner[] = {
  {"from_dataset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_3from_dataset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_2from_dataset},
  {"from_fragment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_5from_fragment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_4from_fragment},
  {"from_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_7from_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_6from_batches},
  {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_9to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_8to_batches},
  {"scan_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_11scan_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_10scan_batches},
  {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_13to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_12to_table},
  {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_15take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_14take},
  {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_17head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_16head},
  {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_19count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_18count_rows},
  {"to_reader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_21to_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_20to_reader},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_23__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_22__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_7Scanner_25__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_7Scanner_24__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_Scanner[] = {
  {"dataset_schema", __pyx_getprop_7pyarrow_8_dataset_7Scanner_dataset_schema, 0, PyDoc_STR("The schema with which batches will be read from fragments."), 0},
  {"projected_schema", __pyx_getprop_7pyarrow_8_dataset_7Scanner_projected_schema, 0, PyDoc_STR("\n        The materialized schema of the data, accounting for projections.\n\n        This is the schema of any data returned from the scanner.\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_Scanner_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Scanner},
  {Py_tp_doc, (void *)PyDoc_STR("Scanner()\n\nA materialized scan operation with context and options bound.\n\nA scanner is the class that glues the scan tasks, data fragments and data\nsources together.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_Scanner},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_Scanner},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_7Scanner_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_Scanner},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_Scanner_spec = {
  "pyarrow._dataset.Scanner",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Scanner),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_Scanner_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_Scanner = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""Scanner", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Scanner), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Scanner, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Scanner()\n\nA materialized scan operation with context and options bound.\n\nA scanner is the class that glues the scan tasks, data fragments and data\nsources together."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_Scanner, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_Scanner, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_7Scanner_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_Scanner, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions __pyx_vtable_7pyarrow_8_dataset_FragmentScanOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_8_dataset_FragmentScanOptions(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_3__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_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_8_dataset_19FragmentScanOptions_type_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_9type_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FragmentScanOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19FragmentScanOptions_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FragmentScanOptions[] = {
  {"type_name", __pyx_getprop_7pyarrow_8_dataset_19FragmentScanOptions_type_name, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FragmentScanOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions},
  {Py_tp_doc, (void *)PyDoc_STR("FragmentScanOptions()\n\nScan options specific to a particular fragment and scan operation.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_8_dataset_FragmentScanOptions},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FragmentScanOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FragmentScanOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FragmentScanOptions_spec = {
  "pyarrow._dataset.FragmentScanOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FragmentScanOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FragmentScanOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FragmentScanOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FragmentScanOptions()\n\nScan options specific to a particular fragment and scan operation."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_8_dataset_FragmentScanOptions, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FragmentScanOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FragmentScanOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19FragmentScanOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat __pyx_vtable_7pyarrow_8_dataset_FileFormat;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileFormat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_FileFormat;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_FileFormat *p = (struct __pyx_obj_7pyarrow_8_dataset_FileFormat *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_8_dataset_FileFormat(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_8_dataset_10FileFormat_9__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_8_dataset_10FileFormat_9__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_8_dataset_10FileFormat_default_extname(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_10FileFormat_15default_extname_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_10FileFormat_default_fragment_scan_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_10FileFormat_default_fragment_scan_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_10FileFormat_29default_fragment_scan_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileFormat[] = {
  {"inspect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_3inspect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_2inspect},
  {"make_fragment", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_5make_fragment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_4make_fragment},
  {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_7make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_6make_write_options},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_10FileFormat_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FileFormat[] = {
  {"default_extname", __pyx_getprop_7pyarrow_8_dataset_10FileFormat_default_extname, 0, 0, 0},
  {"default_fragment_scan_options", __pyx_getprop_7pyarrow_8_dataset_10FileFormat_default_fragment_scan_options, __pyx_setprop_7pyarrow_8_dataset_10FileFormat_default_fragment_scan_options, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileFormat_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat},
  {Py_tp_doc, (void *)PyDoc_STR("FileFormat()")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_8_dataset_FileFormat},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileFormat},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FileFormat},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_10FileFormat_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileFormat},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileFormat_spec = {
  "pyarrow._dataset.FileFormat",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileFormat),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FileFormat_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileFormat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileFormat", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileFormat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FileFormat()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_8_dataset_FileFormat, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileFormat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FileFormat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_10FileFormat_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileFormat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions __pyx_vtable_7pyarrow_8_dataset_FileWriteOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_16FileWriteOptions_format(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_6format_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileWriteOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16FileWriteOptions_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FileWriteOptions[] = {
  {"format", __pyx_getprop_7pyarrow_8_dataset_16FileWriteOptions_format, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileWriteOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions},
  {Py_tp_doc, (void *)PyDoc_STR("FileWriteOptions()")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileWriteOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FileWriteOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileWriteOptions_spec = {
  "pyarrow._dataset.FileWriteOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FileWriteOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileWriteOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileWriteOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FileWriteOptions()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileWriteOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FileWriteOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_16FileWriteOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment __pyx_vtable_7pyarrow_8_dataset_Fragment;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Fragment(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_Fragment *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_Fragment *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_Fragment;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_Fragment(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_Fragment *p = (struct __pyx_obj_7pyarrow_8_dataset_Fragment *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_Fragment) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_Fragment);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_8Fragment_physical_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_8Fragment_15physical_schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_8Fragment_partition_expression(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_8Fragment_20partition_expression_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_Fragment[] = {
  {"scanner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_3scanner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_2scanner},
  {"to_batches", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_5to_batches, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_4to_batches},
  {"to_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_7to_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_6to_table},
  {"take", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_9take, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_8take},
  {"head", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_11head, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_10head},
  {"count_rows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_13count_rows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_12count_rows},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_8Fragment_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_8Fragment_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_Fragment[] = {
  {"physical_schema", __pyx_getprop_7pyarrow_8_dataset_8Fragment_physical_schema, 0, PyDoc_STR("Return the physical schema of this Fragment. This schema can be\n        different from the dataset read schema."), 0},
  {"partition_expression", __pyx_getprop_7pyarrow_8_dataset_8Fragment_partition_expression, 0, PyDoc_STR("An Expression which evaluates to true for all data viewed by this\n        Fragment.\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_Fragment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Fragment},
  {Py_tp_doc, (void *)PyDoc_STR("Fragment()\n\nFragment of data from a Dataset.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_Fragment},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_Fragment},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_8Fragment_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_Fragment},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_Fragment_spec = {
  "pyarrow._dataset.Fragment",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Fragment),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_Fragment_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_Fragment = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""Fragment", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Fragment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Fragment, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Fragment()\n\nFragment of data from a Dataset."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_Fragment, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_Fragment, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_8Fragment_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_Fragment, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFragment __pyx_vtable_7pyarrow_8_dataset_FileFragment;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileFragment(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileFragment *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_Fragment(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileFragment *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Fragment*)__pyx_vtabptr_7pyarrow_8_dataset_FileFragment;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_12FileFragment_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12FileFragment_4path_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_12FileFragment_filesystem(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12FileFragment_10filesystem_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_12FileFragment_buffer(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12FileFragment_6buffer_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_12FileFragment_format(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12FileFragment_6format_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileFragment[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12FileFragment_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12FileFragment_2__reduce__},
  {"open", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12FileFragment_5open, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12FileFragment_4open},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FileFragment[] = {
  {"path", __pyx_getprop_7pyarrow_8_dataset_12FileFragment_path, 0, PyDoc_STR("\n        The path of the data file viewed by this fragment, if it views a\n        file. If instead it views a buffer, this will be \"<Buffer>\".\n        "), 0},
  {"filesystem", __pyx_getprop_7pyarrow_8_dataset_12FileFragment_filesystem, 0, PyDoc_STR("\n        The FileSystem containing the data file viewed by this fragment, if\n        it views a file. If instead it views a buffer, this will be None.\n        "), 0},
  {"buffer", __pyx_getprop_7pyarrow_8_dataset_12FileFragment_buffer, 0, PyDoc_STR("\n        The buffer viewed by this fragment, if it views a buffer. If\n        instead it views a file, this will be None.\n        "), 0},
  {"format", __pyx_getprop_7pyarrow_8_dataset_12FileFragment_format, 0, PyDoc_STR("\n        The format of the data file viewed by this fragment.\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileFragment_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Fragment},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_8_dataset_12FileFragment_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("A Fragment representing a data file.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileFragment},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FileFragment},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileFragment},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileFragment_spec = {
  "pyarrow._dataset.FileFragment",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileFragment),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FileFragment_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileFragment = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileFragment", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileFragment), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Fragment, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_8_dataset_12FileFragment_1__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*/
  PyDoc_STR("A Fragment representing a data file."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileFragment, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FileFragment, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_8_dataset_8Fragment_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileFragment, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning __pyx_vtable_7pyarrow_8_dataset_Partitioning;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_Partitioning(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_Partitioning *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_Partitioning;
  __Pyx_default_placement_construct(&(p->wrapped));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_Partitioning *p = (struct __pyx_obj_7pyarrow_8_dataset_Partitioning *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->wrapped);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_8_dataset_Partitioning(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_8_dataset_12Partitioning_3__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_8_dataset_12Partitioning_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_8_dataset_12Partitioning_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12Partitioning_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_Partitioning[] = {
  {"parse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_5parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_4parse},
  {"format", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_7format, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_6format},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12Partitioning_10__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_Partitioning[] = {
  {"schema", __pyx_getprop_7pyarrow_8_dataset_12Partitioning_schema, 0, PyDoc_STR("The arrow Schema attached to the partitioning."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_Partitioning_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning},
  {Py_tp_doc, (void *)PyDoc_STR("Partitioning()")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_8_dataset_Partitioning},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_Partitioning},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_Partitioning},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_12Partitioning_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_Partitioning},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_Partitioning_spec = {
  "pyarrow._dataset.Partitioning",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Partitioning),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_Partitioning_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_Partitioning = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""Partitioning", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_Partitioning), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Partitioning()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_8_dataset_Partitioning, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_Partitioning, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_Partitioning, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_12Partitioning_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_Partitioning, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_PartitioningFactory __pyx_vtable_7pyarrow_8_dataset_PartitioningFactory;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_PartitioningFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_PartitioningFactory;
  __Pyx_default_placement_construct(&(p->wrapped));
  p->constructor = Py_None; Py_INCREF(Py_None);
  p->options = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_PartitioningFactory(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *p = (struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_PartitioningFactory) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->wrapped);
  Py_CLEAR(p->constructor);
  Py_CLEAR(p->options);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_PartitioningFactory);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_PartitioningFactory(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *p = (struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_PartitioningFactory); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->constructor) {
    e = (*v)(p->constructor, a); if (e) return e;
  }
  if (p->options) {
    e = (*v)(p->options, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_PartitioningFactory(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *p = (struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_PartitioningFactory); }
  tmp = ((PyObject*)p->constructor);
  p->constructor = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->options);
  p->options = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_19PartitioningFactory_type_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_9type_name_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_PartitioningFactory[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19PartitioningFactory_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_PartitioningFactory[] = {
  {"type_name", __pyx_getprop_7pyarrow_8_dataset_19PartitioningFactory_type_name, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_PartitioningFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_PartitioningFactory},
  {Py_tp_doc, (void *)PyDoc_STR("PartitioningFactory()")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_PartitioningFactory},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_PartitioningFactory},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_PartitioningFactory},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_PartitioningFactory},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_PartitioningFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_PartitioningFactory_spec = {
  "pyarrow._dataset.PartitioningFactory",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_PartitioningFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_PartitioningFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""PartitioningFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_PartitioningFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("PartitioningFactory()"), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_PartitioningFactory, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_PartitioningFactory, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_PartitioningFactory, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_PartitioningFactory, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19PartitioningFactory_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_PartitioningFactory, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_WrittenFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)o);
  p->path = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->metadata = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_WrittenFile(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *p = (struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_WrittenFile) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->path);
  Py_CLEAR(p->metadata);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_WrittenFile);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_WrittenFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *p = (struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_WrittenFile); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->metadata) {
    e = (*v)(p->metadata, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_WrittenFile(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *p = (struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_WrittenFile); }
  tmp = ((PyObject*)p->metadata);
  p->metadata = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_11WrittenFile_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_path(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_3__set__(o, v);
  }
  else {
    return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4path_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_11WrittenFile_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_metadata(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_3__set__(o, v);
  }
  else {
    return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_8metadata_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_11WrittenFile_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4size_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_11WrittenFile_4size_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_WrittenFile[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_11WrittenFile_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_11WrittenFile_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_WrittenFile[] = {
  {"path", __pyx_getprop_7pyarrow_8_dataset_11WrittenFile_path, __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_path, PyDoc_STR("path: str"), 0},
  {"metadata", __pyx_getprop_7pyarrow_8_dataset_11WrittenFile_metadata, __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_metadata, PyDoc_STR("metadata: object"), 0},
  {"size", __pyx_getprop_7pyarrow_8_dataset_11WrittenFile_size, __pyx_setprop_7pyarrow_8_dataset_11WrittenFile_size, PyDoc_STR("size: 'int64_t'"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_WrittenFile_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_WrittenFile},
  {Py_tp_doc, (void *)PyDoc_STR("WrittenFile(path, metadata, size)\n\nMetadata information about files written as\npart of a dataset write operation\n\nParameters\n----------\npath : str\n    Path to the file.\nmetadata : pyarrow.parquet.FileMetaData, optional\n    For Parquet files, the Parquet file metadata.\nsize : int\n    The size of the file in bytes.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_WrittenFile},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_WrittenFile},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_WrittenFile},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_WrittenFile},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_11WrittenFile_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_WrittenFile},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_WrittenFile_spec = {
  "pyarrow._dataset.WrittenFile",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_WrittenFile_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_WrittenFile = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""WrittenFile", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_WrittenFile, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("WrittenFile(path, metadata, size)\n\nMetadata information about files written as\npart of a dataset write operation\n\nParameters\n----------\npath : str\n    Path to the file.\nmetadata : pyarrow.parquet.FileMetaData, optional\n    For Parquet files, the Parquet file metadata.\nsize : int\n    The size of the file in bytes."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_WrittenFile, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_WrittenFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_WrittenFile, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_WrittenFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_11WrittenFile_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_WrittenFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_InMemoryDataset __pyx_vtable_7pyarrow_8_dataset_InMemoryDataset;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_InMemoryDataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_Dataset(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset*)__pyx_vtabptr_7pyarrow_8_dataset_InMemoryDataset;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_InMemoryDataset[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_15InMemoryDataset_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_InMemoryDataset_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Dataset},
  {Py_tp_doc, (void *)PyDoc_STR("InMemoryDataset(source, Schema schema=None)\n\nA Dataset wrapping in-memory data.\n\nParameters\n----------\nsource : RecordBatch, Table, list, tuple\n    The data for this dataset. Can be a RecordBatch, Table, list of\n    RecordBatch/Table, iterable of RecordBatch, or a RecordBatchReader\n    If an iterable is provided, the schema must also be provided.\nschema : Schema, optional\n    Only required if passing an iterable as the source")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_Dataset},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_Dataset},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_InMemoryDataset},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_InMemoryDataset},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_InMemoryDataset_spec = {
  "pyarrow._dataset.InMemoryDataset",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_InMemoryDataset_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_InMemoryDataset = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""InMemoryDataset", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("InMemoryDataset(source, Schema schema=None)\n\nA Dataset wrapping in-memory data.\n\nParameters\n----------\nsource : RecordBatch, Table, list, tuple\n    The data for this dataset. Can be a RecordBatch, Table, list of\n    RecordBatch/Table, iterable of RecordBatch, or a RecordBatchReader\n    If an iterable is provided, the schema must also be provided.\nschema : Schema, optional\n    Only required if passing an iterable as the source"), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_Dataset, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_InMemoryDataset, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_15InMemoryDataset_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_InMemoryDataset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDataset __pyx_vtable_7pyarrow_8_dataset_UnionDataset;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_UnionDataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_Dataset(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_UnionDataset *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset*)__pyx_vtabptr_7pyarrow_8_dataset_UnionDataset;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_12UnionDataset_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_12UnionDataset_8children_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_UnionDataset[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_12UnionDataset_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_12UnionDataset_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_UnionDataset[] = {
  {"children", __pyx_getprop_7pyarrow_8_dataset_12UnionDataset_children, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_UnionDataset_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Dataset},
  {Py_tp_doc, (void *)PyDoc_STR("UnionDataset(Schema schema, children)\n\nA Dataset wrapping child datasets.\n\nChildren's schemas must agree with the provided schema.\n\nParameters\n----------\nschema : Schema\n    A known schema to conform to.\nchildren : list of Dataset\n    One or more input children")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_Dataset},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_Dataset},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_UnionDataset},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_UnionDataset},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_12UnionDataset_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_UnionDataset},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_UnionDataset_spec = {
  "pyarrow._dataset.UnionDataset",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_UnionDataset_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_UnionDataset = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""UnionDataset", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("UnionDataset(Schema schema, children)\n\nA Dataset wrapping child datasets.\n\nChildren's schemas must agree with the provided schema.\n\nParameters\n----------\nschema : Schema\n    A known schema to conform to.\nchildren : list of Dataset\n    One or more input children"), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_Dataset, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_UnionDataset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_UnionDataset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_12UnionDataset_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_UnionDataset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDataset __pyx_vtable_7pyarrow_8_dataset_FileSystemDataset;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemDataset(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_Dataset(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Dataset*)__pyx_vtabptr_7pyarrow_8_dataset_FileSystemDataset;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_filesystem(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_10filesystem_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_partitioning(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_12partitioning_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_files(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5files_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_format(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_6format_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileSystemDataset[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_2__reduce__},
  {"from_paths", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_5from_paths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_17FileSystemDataset_4from_paths},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FileSystemDataset[] = {
  {"filesystem", __pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_filesystem, 0, 0, 0},
  {"partitioning", __pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_partitioning, 0, PyDoc_STR("\n        The partitioning of the Dataset source, if discovered.\n\n        If the FileSystemDataset is created using the ``dataset()`` factory\n        function with a partitioning specified, this will return the\n        finalized Partitioning object from the dataset discovery. In all\n        other cases, this returns None.\n        "), 0},
  {"files", __pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_files, 0, PyDoc_STR("List of the files"), 0},
  {"format", __pyx_getprop_7pyarrow_8_dataset_17FileSystemDataset_format, 0, PyDoc_STR("The FileFormat of this source."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileSystemDataset_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Dataset},
  {Py_tp_doc, (void *)PyDoc_STR("FileSystemDataset(fragments, Schema schema, FileFormat format, FileSystem filesystem=None, root_partition=None)\n\nA Dataset of file fragments.\n\nA FileSystemDataset is composed of one or more FileFragment.\n\nParameters\n----------\nfragments : list[Fragments]\n    List of fragments to consume.\nschema : Schema\n    The top-level schema of the Dataset.\nformat : FileFormat\n    File format of the fragments, currently only ParquetFileFormat,\n    IpcFileFormat, CsvFileFormat, and JsonFileFormat are supported.\nfilesystem : FileSystem\n    FileSystem of the fragments.\nroot_partition : Expression, optional\n    The top-level partition of the DataDataset.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_Dataset},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_Dataset},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileSystemDataset},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FileSystemDataset},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileSystemDataset},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileSystemDataset_spec = {
  "pyarrow._dataset.FileSystemDataset",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_FileSystemDataset_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileSystemDataset = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileSystemDataset", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Dataset, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FileSystemDataset(fragments, Schema schema, FileFormat format, FileSystem filesystem=None, root_partition=None)\n\nA Dataset of file fragments.\n\nA FileSystemDataset is composed of one or more FileFragment.\n\nParameters\n----------\nfragments : list[Fragments]\n    List of fragments to consume.\nschema : Schema\n    The top-level schema of the Dataset.\nformat : FileFormat\n    File format of the fragments, currently only ParquetFileFormat,\n    IpcFileFormat, CsvFileFormat, and JsonFileFormat are supported.\nfilesystem : FileSystem\n    FileSystem of the fragments.\nroot_partition : Expression, optional\n    The top-level partition of the DataDataset."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_Dataset, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_Dataset, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileSystemDataset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FileSystemDataset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_17FileSystemDataset_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileSystemDataset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileWriteOptions __pyx_vtable_7pyarrow_8_dataset_IpcFileWriteOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_IpcFileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions*)__pyx_vtabptr_7pyarrow_8_dataset_IpcFileWriteOptions;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_19IpcFileWriteOptions_write_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_19IpcFileWriteOptions_write_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_13write_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_IpcFileWriteOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19IpcFileWriteOptions_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_IpcFileWriteOptions[] = {
  {"write_options", __pyx_getprop_7pyarrow_8_dataset_19IpcFileWriteOptions_write_options, __pyx_setprop_7pyarrow_8_dataset_19IpcFileWriteOptions_write_options, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions},
  {Py_tp_doc, (void *)PyDoc_STR("IpcFileWriteOptions()")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_IpcFileWriteOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_IpcFileWriteOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_IpcFileWriteOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions_spec = {
  "pyarrow._dataset.IpcFileWriteOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""IpcFileWriteOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("IpcFileWriteOptions()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_IpcFileWriteOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_IpcFileWriteOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19IpcFileWriteOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_IpcFileWriteOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_IpcFileFormat __pyx_vtable_7pyarrow_8_dataset_IpcFileFormat;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_IpcFileFormat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FileFormat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat*)__pyx_vtabptr_7pyarrow_8_dataset_IpcFileFormat;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_13IpcFileFormat_default_extname(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_15default_extname_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_IpcFileFormat[] = {
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_2equals},
  {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_4make_write_options},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13IpcFileFormat_6__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_IpcFileFormat[] = {
  {"default_extname", __pyx_getprop_7pyarrow_8_dataset_13IpcFileFormat_default_extname, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_IpcFileFormat_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat},
  {Py_tp_doc, (void *)PyDoc_STR("IpcFileFormat()")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_IpcFileFormat},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_IpcFileFormat},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_IpcFileFormat},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_IpcFileFormat_spec = {
  "pyarrow._dataset.IpcFileFormat",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_IpcFileFormat_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_IpcFileFormat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""IpcFileFormat", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("IpcFileFormat()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_IpcFileFormat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_IpcFileFormat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_IpcFileFormat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FeatherFileFormat __pyx_vtable_7pyarrow_8_dataset_FeatherFileFormat;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FeatherFileFormat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_IpcFileFormat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat*)__pyx_vtabptr_7pyarrow_8_dataset_FeatherFileFormat;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_17FeatherFileFormat_default_extname(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_17FeatherFileFormat_15default_extname_1__get__(o);
}

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FeatherFileFormat[] = {
  {"default_extname", __pyx_getprop_7pyarrow_8_dataset_17FeatherFileFormat_default_extname, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FeatherFileFormat_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FeatherFileFormat},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FeatherFileFormat},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FeatherFileFormat_spec = {
  "pyarrow._dataset.FeatherFileFormat",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FeatherFileFormat_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FeatherFileFormat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FeatherFileFormat", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  0, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FeatherFileFormat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_8_dataset_13IpcFileFormat_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FeatherFileFormat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileFormat __pyx_vtable_7pyarrow_8_dataset_CsvFileFormat;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFileFormat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FileFormat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat*)__pyx_vtabptr_7pyarrow_8_dataset_CsvFileFormat;
  p->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileFormat(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileFormat) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_read_options_py);
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat(o);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileFormat(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileFormat); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_read_options_py) {
    e = (*v)(((PyObject *)p->_read_options_py), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_CsvFileFormat(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_CsvFileFormat); }
  tmp = ((PyObject*)p->_read_options_py);
  p->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_13CsvFileFormat_parse_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_13CsvFileFormat_parse_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_13parse_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_13CsvFileFormat__read_options_py(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_13CsvFileFormat__read_options_py(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_3__set__(o, v);
  }
  else {
    return __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_16_read_options_py_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_CsvFileFormat[] = {
  {"make_write_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_2make_write_options},
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_5equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_4equals},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_13CsvFileFormat_6__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_CsvFileFormat[] = {
  {"parse_options", __pyx_getprop_7pyarrow_8_dataset_13CsvFileFormat_parse_options, __pyx_setprop_7pyarrow_8_dataset_13CsvFileFormat_parse_options, 0, 0},
  {"_read_options_py", __pyx_getprop_7pyarrow_8_dataset_13CsvFileFormat__read_options_py, __pyx_setprop_7pyarrow_8_dataset_13CsvFileFormat__read_options_py, PyDoc_STR("_read_options_py: pyarrow._csv.ReadOptions"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_CsvFileFormat_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileFormat},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("CsvFileFormat(ParseOptions parse_options=None, default_fragment_scan_options=None, ConvertOptions convert_options=None, ReadOptions read_options=None)\n\nFileFormat for CSV files.\n\nParameters\n----------\nparse_options : pyarrow.csv.ParseOptions\n    Options regarding CSV parsing.\ndefault_fragment_scan_options : CsvFragmentScanOptions\n    Default options for fragments scan.\nconvert_options : pyarrow.csv.ConvertOptions\n    Options regarding value conversion.\nread_options : pyarrow.csv.ReadOptions\n    General read options.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_CsvFileFormat},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_CsvFileFormat},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_CsvFileFormat},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_CsvFileFormat},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_CsvFileFormat},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_CsvFileFormat_spec = {
  "pyarrow._dataset.CsvFileFormat",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_CsvFileFormat_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_CsvFileFormat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""CsvFileFormat", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileFormat, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("CsvFileFormat(ParseOptions parse_options=None, default_fragment_scan_options=None, ConvertOptions convert_options=None, ReadOptions read_options=None)\n\nFileFormat for CSV files.\n\nParameters\n----------\nparse_options : pyarrow.csv.ParseOptions\n    Options regarding CSV parsing.\ndefault_fragment_scan_options : CsvFragmentScanOptions\n    Default options for fragments scan.\nconvert_options : pyarrow.csv.ConvertOptions\n    Options regarding value conversion.\nread_options : pyarrow.csv.ReadOptions\n    General read options."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileFormat, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_CsvFileFormat, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_CsvFileFormat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_CsvFileFormat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_13CsvFileFormat_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_CsvFileFormat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFragmentScanOptions __pyx_vtable_7pyarrow_8_dataset_CsvFragmentScanOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions*)__pyx_vtabptr_7pyarrow_8_dataset_CsvFragmentScanOptions;
  p->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFragmentScanOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFragmentScanOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_read_options_py);
  __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions(o);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_CsvFragmentScanOptions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_CsvFragmentScanOptions); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_read_options_py) {
    e = (*v)(((PyObject *)p->_read_options_py), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_CsvFragmentScanOptions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_CsvFragmentScanOptions); }
  tmp = ((PyObject*)p->_read_options_py);
  p->_read_options_py = ((struct __pyx_obj_7pyarrow_4_csv_ReadOptions *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_convert_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_convert_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_15convert_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_read_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_read_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_12read_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_CsvFragmentScanOptions[] = {
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_2equals},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_22CsvFragmentScanOptions_4__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_CsvFragmentScanOptions[] = {
  {"convert_options", __pyx_getprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_convert_options, __pyx_setprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_convert_options, 0, 0},
  {"read_options", __pyx_getprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_read_options, __pyx_setprop_7pyarrow_8_dataset_22CsvFragmentScanOptions_read_options, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {Py_tp_doc, (void *)PyDoc_STR("CsvFragmentScanOptions(ConvertOptions convert_options=None, ReadOptions read_options=None)\n\nScan-specific options for CSV fragments.\n\nParameters\n----------\nconvert_options : pyarrow.csv.ConvertOptions\n    Options regarding value conversion.\nread_options : pyarrow.csv.ReadOptions\n    General read options.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_CsvFragmentScanOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions_spec = {
  "pyarrow._dataset.CsvFragmentScanOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""CsvFragmentScanOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("CsvFragmentScanOptions(ConvertOptions convert_options=None, ReadOptions read_options=None)\n\nScan-specific options for CSV fragments.\n\nParameters\n----------\nconvert_options : pyarrow.csv.ConvertOptions\n    Options regarding value conversion.\nread_options : pyarrow.csv.ReadOptions\n    General read options."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_22CsvFragmentScanOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_CsvFragmentScanOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_CsvFileWriteOptions __pyx_vtable_7pyarrow_8_dataset_CsvFileWriteOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_CsvFileWriteOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FileWriteOptions(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileWriteOptions*)__pyx_vtabptr_7pyarrow_8_dataset_CsvFileWriteOptions;
  p->_properties = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileWriteOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileWriteOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_properties);
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileWriteOptions(o);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileWriteOptions(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileWriteOptions); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_properties) {
    e = (*v)(p->_properties, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_CsvFileWriteOptions(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_CsvFileWriteOptions); }
  tmp = ((PyObject*)p->_properties);
  p->_properties = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_19CsvFileWriteOptions_write_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_19CsvFileWriteOptions_write_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_13write_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_CsvFileWriteOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19CsvFileWriteOptions_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_CsvFileWriteOptions[] = {
  {"write_options", __pyx_getprop_7pyarrow_8_dataset_19CsvFileWriteOptions_write_options, __pyx_setprop_7pyarrow_8_dataset_19CsvFileWriteOptions_write_options, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileWriteOptions},
  {Py_tp_doc, (void *)PyDoc_STR("CsvFileWriteOptions()")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_CsvFileWriteOptions},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_CsvFileWriteOptions},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_CsvFileWriteOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_CsvFileWriteOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_CsvFileWriteOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions_spec = {
  "pyarrow._dataset.CsvFileWriteOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""CsvFileWriteOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("CsvFileWriteOptions()"), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19CsvFileWriteOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_CsvFileWriteOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFileFormat __pyx_vtable_7pyarrow_8_dataset_JsonFileFormat;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_JsonFileFormat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FileFormat(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FileFormat*)__pyx_vtabptr_7pyarrow_8_dataset_JsonFileFormat;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_JsonFileFormat[] = {
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_2equals},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_14JsonFileFormat_4__reduce__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_JsonFileFormat_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_7__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("JsonFileFormat(default_fragment_scan_options=None, ParseOptions parse_options=None, ReadOptions read_options=None)\n\nFileFormat for JSON files.\n\nParameters\n----------\ndefault_fragment_scan_options : JsonFragmentScanOptions\n    Default options for fragments scan.\nparse_options : pyarrow.json.ParseOptions\n    Options regarding json parsing.\nread_options : pyarrow.json.ReadOptions\n    General read options.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_JsonFileFormat},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_JsonFileFormat},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_JsonFileFormat_spec = {
  "pyarrow._dataset.JsonFileFormat",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_JsonFileFormat_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_JsonFileFormat = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""JsonFileFormat", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileFormat, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_7__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*/
  PyDoc_STR("JsonFileFormat(default_fragment_scan_options=None, ParseOptions parse_options=None, ReadOptions read_options=None)\n\nFileFormat for JSON files.\n\nParameters\n----------\ndefault_fragment_scan_options : JsonFragmentScanOptions\n    Default options for fragments scan.\nparse_options : pyarrow.json.ParseOptions\n    Options regarding json parsing.\nread_options : pyarrow.json.ReadOptions\n    General read options."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_JsonFileFormat, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_14JsonFileFormat_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_JsonFileFormat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_JsonFragmentScanOptions __pyx_vtable_7pyarrow_8_dataset_JsonFragmentScanOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_JsonFragmentScanOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_FragmentScanOptions(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_FragmentScanOptions*)__pyx_vtabptr_7pyarrow_8_dataset_JsonFragmentScanOptions;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_parse_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_parse_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_13parse_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_read_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_read_options(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_12read_options_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_JsonFragmentScanOptions[] = {
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_2equals},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_23JsonFragmentScanOptions_4__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_JsonFragmentScanOptions[] = {
  {"parse_options", __pyx_getprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_parse_options, __pyx_setprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_parse_options, 0, 0},
  {"read_options", __pyx_getprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_read_options, __pyx_setprop_7pyarrow_8_dataset_23JsonFragmentScanOptions_read_options, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions},
  {Py_tp_doc, (void *)PyDoc_STR("JsonFragmentScanOptions(ParseOptions parse_options=None, ReadOptions read_options=None)\n\nScan-specific options for JSON fragments.\n\nParameters\n----------\nparse_options : pyarrow.json.ParseOptions\n    Options regarding JSON parsing.\nread_options : pyarrow.json.ReadOptions\n    General read options.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_JsonFragmentScanOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_JsonFragmentScanOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_JsonFragmentScanOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions_spec = {
  "pyarrow._dataset.JsonFragmentScanOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""JsonFragmentScanOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FragmentScanOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("JsonFragmentScanOptions(ParseOptions parse_options=None, ReadOptions read_options=None)\n\nScan-specific options for JSON fragments.\n\nParameters\n----------\nparse_options : pyarrow.json.ParseOptions\n    Options regarding JSON parsing.\nread_options : pyarrow.json.ReadOptions\n    General read options."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_JsonFragmentScanOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_JsonFragmentScanOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_23JsonFragmentScanOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_JsonFragmentScanOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_KeyValuePartitioning __pyx_vtable_7pyarrow_8_dataset_KeyValuePartitioning;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_Partitioning(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning*)__pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning;
  return o;
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_20KeyValuePartitioning_dictionaries(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_12dictionaries_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_KeyValuePartitioning[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_20KeyValuePartitioning_2__reduce__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_KeyValuePartitioning[] = {
  {"dictionaries", __pyx_getprop_7pyarrow_8_dataset_20KeyValuePartitioning_dictionaries, 0, PyDoc_STR("\n        The unique values for each partition field, if available.\n\n        Those values are only available if the Partitioning object was\n        created through dataset discovery from a PartitioningFactory, or\n        if the dictionaries were manually specified in the constructor.\n        If no dictionary field is available, this returns an empty list.\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_KeyValuePartitioning_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning},
  {Py_tp_doc, (void *)PyDoc_STR("KeyValuePartitioning()")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_KeyValuePartitioning},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_KeyValuePartitioning},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_KeyValuePartitioning_spec = {
  "pyarrow._dataset.KeyValuePartitioning",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_KeyValuePartitioning_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_KeyValuePartitioning = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""KeyValuePartitioning", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("KeyValuePartitioning()"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_KeyValuePartitioning, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_KeyValuePartitioning, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_20KeyValuePartitioning_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_DirectoryPartitioning __pyx_vtable_7pyarrow_8_dataset_DirectoryPartitioning;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_DirectoryPartitioning(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning*)__pyx_vtabptr_7pyarrow_8_dataset_DirectoryPartitioning;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_DirectoryPartitioning[] = {
  {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_3discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_21DirectoryPartitioning_2discover},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_DirectoryPartitioning_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning},
  {Py_tp_doc, (void *)PyDoc_STR("DirectoryPartitioning(Schema schema, dictionaries=None, segment_encoding='uri')\n\nA Partitioning based on a specified Schema.\n\nThe DirectoryPartitioning expects one segment in the file path for each\nfield in the schema (all fields are required to be present).\nFor example given schema<year:int16, month:int8> the path \"/2009/11\" would\nbe parsed to (\"year\"_ == 2009 and \"month\"_ == 11).\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nDirectoryPartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import DirectoryPartitioning\n>>> partitioning = DirectoryPartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"/2009/11/\"))\n((year == 2009) and (month == 11))")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_DirectoryPartitioning},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_DirectoryPartitioning},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_DirectoryPartitioning_spec = {
  "pyarrow._dataset.DirectoryPartitioning",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_DirectoryPartitioning_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_DirectoryPartitioning = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""DirectoryPartitioning", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("DirectoryPartitioning(Schema schema, dictionaries=None, segment_encoding='uri')\n\nA Partitioning based on a specified Schema.\n\nThe DirectoryPartitioning expects one segment in the file path for each\nfield in the schema (all fields are required to be present).\nFor example given schema<year:int16, month:int8> the path \"/2009/11\" would\nbe parsed to (\"year\"_ == 2009 and \"month\"_ == 11).\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nDirectoryPartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import DirectoryPartitioning\n>>> partitioning = DirectoryPartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"/2009/11/\"))\n((year == 2009) and (month == 11))"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_DirectoryPartitioning, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_21DirectoryPartitioning_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_DirectoryPartitioning, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_HivePartitioning __pyx_vtable_7pyarrow_8_dataset_HivePartitioning;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_HivePartitioning(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning*)__pyx_vtabptr_7pyarrow_8_dataset_HivePartitioning;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_HivePartitioning[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_3__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16HivePartitioning_2__reduce__},
  {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_5discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16HivePartitioning_4discover},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_HivePartitioning_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning},
  {Py_tp_doc, (void *)PyDoc_STR("HivePartitioning(Schema schema, dictionaries=None, null_fallback='__HIVE_DEFAULT_PARTITION__', segment_encoding='uri')\n\nA Partitioning for \"/$key=$value/\" nested directories as found in\nApache Hive.\n\nMulti-level, directory based partitioning scheme originating from\nApache Hive with all data files stored in the leaf directories. Data is\npartitioned by static values of a particular column in the schema.\nPartition keys are represented in the form $key=$value in directory names.\nField order is ignored, as are missing or unrecognized field names.\n\nFor example, given schema<year:int16, month:int8, day:int8>, a possible\npath would be \"/year=2009/month=11/day=15\".\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nnull_fallback : str, default \"__HIVE_DEFAULT_PARTITION__\"\n    If any field is None then this fallback will be used as a label\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nHivePartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import HivePartitioning\n>>> partitioning = HivePartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"/year=2009/month=11/\"))\n((year == 2009) and (month == 11))")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_HivePartitioning},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_16HivePartitioning_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_HivePartitioning},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_HivePartitioning_spec = {
  "pyarrow._dataset.HivePartitioning",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_HivePartitioning_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_HivePartitioning = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""HivePartitioning", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("HivePartitioning(Schema schema, dictionaries=None, null_fallback='__HIVE_DEFAULT_PARTITION__', segment_encoding='uri')\n\nA Partitioning for \"/$key=$value/\" nested directories as found in\nApache Hive.\n\nMulti-level, directory based partitioning scheme originating from\nApache Hive with all data files stored in the leaf directories. Data is\npartitioned by static values of a particular column in the schema.\nPartition keys are represented in the form $key=$value in directory names.\nField order is ignored, as are missing or unrecognized field names.\n\nFor example, given schema<year:int16, month:int8, day:int8>, a possible\npath would be \"/year=2009/month=11/day=15\".\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nnull_fallback : str, default \"__HIVE_DEFAULT_PARTITION__\"\n    If any field is None then this fallback will be used as a label\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nHivePartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import HivePartitioning\n>>> partitioning = HivePartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"/year=2009/month=11/\"))\n((year == 2009) and (month == 11))"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_HivePartitioning, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_16HivePartitioning_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_HivePartitioning, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FilenamePartitioning __pyx_vtable_7pyarrow_8_dataset_FilenamePartitioning;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FilenamePartitioning(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_KeyValuePartitioning(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_Partitioning*)__pyx_vtabptr_7pyarrow_8_dataset_FilenamePartitioning;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FilenamePartitioning[] = {
  {"discover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_3discover, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_20FilenamePartitioning_2discover},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FilenamePartitioning_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning},
  {Py_tp_doc, (void *)PyDoc_STR("FilenamePartitioning(Schema schema, dictionaries=None, segment_encoding='uri')\n\nA Partitioning based on a specified Schema.\n\nThe FilenamePartitioning expects one segment in the file name for each\nfield in the schema (all fields are required to be present) separated\nby '_'. For example given schema<year:int16, month:int8> the name\n``\"2009_11_\"`` would be parsed to (\"year\" == 2009 and \"month\" == 11).\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nFilenamePartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import FilenamePartitioning\n>>> partitioning = FilenamePartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"2009_11_data.parquet\"))\n((year == 2009) and (month == 11))")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FilenamePartitioning},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FilenamePartitioning},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FilenamePartitioning_spec = {
  "pyarrow._dataset.FilenamePartitioning",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FilenamePartitioning_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FilenamePartitioning = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FilenamePartitioning", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_Partitioning, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FilenamePartitioning(Schema schema, dictionaries=None, segment_encoding='uri')\n\nA Partitioning based on a specified Schema.\n\nThe FilenamePartitioning expects one segment in the file name for each\nfield in the schema (all fields are required to be present) separated\nby '_'. For example given schema<year:int16, month:int8> the name\n``\"2009_11_\"`` would be parsed to (\"year\" == 2009 and \"month\" == 11).\n\nParameters\n----------\nschema : Schema\n    The schema that describes the partitions present in the file path.\ndictionaries : dict[str, Array]\n    If the type of any field of `schema` is a dictionary type, the\n    corresponding entry of `dictionaries` must be an array containing\n    every value which may be taken by the corresponding column or an\n    error will be raised in parsing.\nsegment_encoding : str, default \"uri\"\n    After splitting paths into segments, decode the segments. Valid\n    values are \"uri\" (URI-decode segments) and \"none\" (leave as-is).\n\nReturns\n-------\nFilenamePartitioning\n\nExamples\n--------\n>>> from pyarrow.dataset import FilenamePartitioning\n>>> partitioning = FilenamePartitioning(\n...     pa.schema([(\"year\", pa.int16()), (\"month\", pa.int8())]))\n>>> print(partitioning.parse(\"2009_11_data.parquet\"))\n((year == 2009) and (month == 11))"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FilenamePartitioning, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_20FilenamePartitioning_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FilenamePartitioning, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemFactoryOptions __pyx_vtable_7pyarrow_8_dataset_FileSystemFactoryOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemFactoryOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_FileSystemFactoryOptions;
  __Pyx_default_placement_construct(&(p->options));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_FileSystemFactoryOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *p = (struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_FileSystemFactoryOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->options);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_FileSystemFactoryOptions);
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_12partitioning_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning_factory(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning_factory(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_20partitioning_factory_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partition_base_dir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partition_base_dir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_18partition_base_dir_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_exclude_invalid_files(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_exclude_invalid_files(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_21exclude_invalid_files_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_selector_ignore_prefixes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_1__get__(o);
}

static int __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_selector_ignore_prefixes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_24selector_ignore_prefixes_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileSystemFactoryOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemFactoryOptions_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_8_dataset_FileSystemFactoryOptions[] = {
  {"partitioning", __pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning, __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning, PyDoc_STR("Partitioning to apply to discovered files.\n\n        NOTE: setting this property will overwrite partitioning_factory.\n        "), 0},
  {"partitioning_factory", __pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning_factory, __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partitioning_factory, PyDoc_STR("PartitioningFactory to apply to discovered files and\n        discover a Partitioning.\n\n        NOTE: setting this property will overwrite partitioning.\n        "), 0},
  {"partition_base_dir", __pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partition_base_dir, __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_partition_base_dir, PyDoc_STR("\n        Base directory to strip paths before applying the partitioning.\n        "), 0},
  {"exclude_invalid_files", __pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_exclude_invalid_files, __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_exclude_invalid_files, PyDoc_STR("Whether to exclude invalid files."), 0},
  {"selector_ignore_prefixes", __pyx_getprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_selector_ignore_prefixes, __pyx_setprop_7pyarrow_8_dataset_24FileSystemFactoryOptions_selector_ignore_prefixes, PyDoc_STR("\n        List of prefixes. Files matching one of those prefixes will be\n        ignored by the discovery process.\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_FileSystemFactoryOptions},
  {Py_tp_doc, (void *)PyDoc_STR("FileSystemFactoryOptions(partition_base_dir=None, partitioning=None, exclude_invalid_files=None, list selector_ignore_prefixes=None)\n\nInfluences the discovery of filesystem paths.\n\nParameters\n----------\npartition_base_dir : str, optional\n    For the purposes of applying the partitioning, paths will be\n    stripped of the partition_base_dir. Files not matching the\n    partition_base_dir prefix will be skipped for partitioning discovery.\n    The ignored files will still be part of the Dataset, but will not\n    have partition information.\npartitioning : Partitioning/PartitioningFactory, optional\n   Apply the Partitioning to every discovered Fragment. See Partitioning or\n   PartitioningFactory documentation.\nexclude_invalid_files : bool, optional (default False)\n    If True, invalid files will be excluded (file format specific check).\n    This will incur IO for each files in a serial and single threaded\n    fashion. Disabling this feature will skip the IO, but unsupported\n    files may be present in the Dataset (resulting in an error at scan\n    time).\nselector_ignore_prefixes : list, optional\n    When discovering from a Selector (and not from an explicit file list),\n    ignore files and directories matching any of these prefixes.\n    By default this is ['.', '_'].")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileSystemFactoryOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_8_dataset_FileSystemFactoryOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileSystemFactoryOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions_spec = {
  "pyarrow._dataset.FileSystemFactoryOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileSystemFactoryOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_FileSystemFactoryOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FileSystemFactoryOptions(partition_base_dir=None, partitioning=None, exclude_invalid_files=None, list selector_ignore_prefixes=None)\n\nInfluences the discovery of filesystem paths.\n\nParameters\n----------\npartition_base_dir : str, optional\n    For the purposes of applying the partitioning, paths will be\n    stripped of the partition_base_dir. Files not matching the\n    partition_base_dir prefix will be skipped for partitioning discovery.\n    The ignored files will still be part of the Dataset, but will not\n    have partition information.\npartitioning : Partitioning/PartitioningFactory, optional\n   Apply the Partitioning to every discovered Fragment. See Partitioning or\n   PartitioningFactory documentation.\nexclude_invalid_files : bool, optional (default False)\n    If True, invalid files will be excluded (file format specific check).\n    This will incur IO for each files in a serial and single threaded\n    fashion. Disabling this feature will skip the IO, but unsupported\n    files may be present in the Dataset (resulting in an error at scan\n    time).\nselector_ignore_prefixes : list, optional\n    When discovering from a Selector (and not from an explicit file list),\n    ignore files and directories matching any of these prefixes.\n    By default this is ['.', '_']."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileSystemFactoryOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_8_dataset_FileSystemFactoryOptions, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_24FileSystemFactoryOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileSystemFactoryOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_FileSystemDatasetFactory __pyx_vtable_7pyarrow_8_dataset_FileSystemDatasetFactory;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_FileSystemDatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_DatasetFactory(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory*)__pyx_vtabptr_7pyarrow_8_dataset_FileSystemDatasetFactory;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_FileSystemDatasetFactory[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_24FileSystemDatasetFactory_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory},
  {Py_tp_doc, (void *)PyDoc_STR("FileSystemDatasetFactory(FileSystem filesystem, paths_or_selector, FileFormat format, FileSystemFactoryOptions options=None)\n\nCreate a DatasetFactory from a list of paths with schema inspection.\n\nParameters\n----------\nfilesystem : pyarrow.fs.FileSystem\n    Filesystem to discover.\npaths_or_selector : pyarrow.fs.FileSelector or list of path-likes\n    Either a Selector object or a list of path-like objects.\nformat : FileFormat\n    Currently only ParquetFileFormat and IpcFileFormat are supported.\noptions : FileSystemFactoryOptions, optional\n    Various flags influencing the discovery of filesystem paths.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_FileSystemDatasetFactory},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_FileSystemDatasetFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory_spec = {
  "pyarrow._dataset.FileSystemDatasetFactory",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""FileSystemDatasetFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("FileSystemDatasetFactory(FileSystem filesystem, paths_or_selector, FileFormat format, FileSystemFactoryOptions options=None)\n\nCreate a DatasetFactory from a list of paths with schema inspection.\n\nParameters\n----------\nfilesystem : pyarrow.fs.FileSystem\n    Filesystem to discover.\npaths_or_selector : pyarrow.fs.FileSelector or list of path-likes\n    Either a Selector object or a list of path-like objects.\nformat : FileFormat\n    Currently only ParquetFileFormat and IpcFileFormat are supported.\noptions : FileSystemFactoryOptions, optional\n    Various flags influencing the discovery of filesystem paths."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_FileSystemDatasetFactory, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_24FileSystemDatasetFactory_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_FileSystemDatasetFactory, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_UnionDatasetFactory __pyx_vtable_7pyarrow_8_dataset_UnionDatasetFactory;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_UnionDatasetFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *p;
  PyObject *o = __pyx_tp_new_7pyarrow_8_dataset_DatasetFactory(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_8_dataset_DatasetFactory*)__pyx_vtabptr_7pyarrow_8_dataset_UnionDatasetFactory;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_UnionDatasetFactory[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19UnionDatasetFactory_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_UnionDatasetFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory},
  {Py_tp_doc, (void *)PyDoc_STR("UnionDatasetFactory(list factories)\n\nProvides a way to inspect/discover a Dataset's expected schema before\nmaterialization.\n\nParameters\n----------\nfactories : list of DatasetFactory")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_UnionDatasetFactory},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_UnionDatasetFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_UnionDatasetFactory_spec = {
  "pyarrow._dataset.UnionDatasetFactory",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset_UnionDatasetFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_UnionDatasetFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""UnionDatasetFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_DatasetFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("UnionDatasetFactory(list factories)\n\nProvides a way to inspect/discover a Dataset's expected schema before\nmaterialization.\n\nParameters\n----------\nfactories : list of DatasetFactory"), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_UnionDatasetFactory, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19UnionDatasetFactory_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_UnionDatasetFactory, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_RecordBatchIterator __pyx_vtable_7pyarrow_8_dataset_RecordBatchIterator;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_RecordBatchIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_RecordBatchIterator;
  __Pyx_default_placement_construct(&(p->iterator));
  p->iterator_owner = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_RecordBatchIterator(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_RecordBatchIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->iterator);
  Py_CLEAR(p->iterator_owner);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_RecordBatchIterator);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_RecordBatchIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_RecordBatchIterator); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->iterator_owner) {
    e = (*v)(p->iterator_owner, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_RecordBatchIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_RecordBatchIterator); }
  tmp = ((PyObject*)p->iterator_owner);
  p->iterator_owner = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_RecordBatchIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_19RecordBatchIterator_8__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_RecordBatchIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_RecordBatchIterator},
  {Py_tp_doc, (void *)PyDoc_STR("RecordBatchIterator()\n\nAn iterator over a sequence of record batches.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_RecordBatchIterator},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_RecordBatchIterator},
  {Py_tp_iter, (void *)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_3__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_RecordBatchIterator},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_RecordBatchIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_RecordBatchIterator_spec = {
  "pyarrow._dataset.RecordBatchIterator",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_RecordBatchIterator_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_RecordBatchIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""RecordBatchIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_RecordBatchIterator, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("RecordBatchIterator()\n\nAn iterator over a sequence of record batches."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_RecordBatchIterator, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_RecordBatchIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_3__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_5__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_RecordBatchIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_19RecordBatchIterator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_RecordBatchIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset_TaggedRecordBatchIterator __pyx_vtable_7pyarrow_8_dataset_TaggedRecordBatchIterator;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset_TaggedRecordBatchIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_8_dataset_TaggedRecordBatchIterator;
  __Pyx_default_placement_construct(&(p->iterator));
  p->iterator_owner = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset_TaggedRecordBatchIterator(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset_TaggedRecordBatchIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->iterator);
  Py_CLEAR(p->iterator_owner);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset_TaggedRecordBatchIterator);
}

static int __pyx_tp_traverse_7pyarrow_8_dataset_TaggedRecordBatchIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_8_dataset_TaggedRecordBatchIterator); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->iterator_owner) {
    e = (*v)(p->iterator_owner, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_8_dataset_TaggedRecordBatchIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *p = (struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_8_dataset_TaggedRecordBatchIterator); }
  tmp = ((PyObject*)p->iterator_owner);
  p->iterator_owner = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset_TaggedRecordBatchIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_25TaggedRecordBatchIterator_8__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset_TaggedRecordBatchIterator},
  {Py_tp_doc, (void *)PyDoc_STR("TaggedRecordBatchIterator()\n\nAn iterator over a sequence of record batches with fragments.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset_TaggedRecordBatchIterator},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_8_dataset_TaggedRecordBatchIterator},
  {Py_tp_iter, (void *)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_3__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset_TaggedRecordBatchIterator},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset_TaggedRecordBatchIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator_spec = {
  "pyarrow._dataset.TaggedRecordBatchIterator",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""TaggedRecordBatchIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset_TaggedRecordBatchIterator, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("TaggedRecordBatchIterator()\n\nAn iterator over a sequence of record batches with fragments."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_8_dataset_TaggedRecordBatchIterator, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_8_dataset_TaggedRecordBatchIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_3__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_5__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_8_dataset_TaggedRecordBatchIterator, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_8_dataset_25TaggedRecordBatchIterator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset_TaggedRecordBatchIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7pyarrow_8_dataset__ScanNodeOptions __pyx_vtable_7pyarrow_8_dataset__ScanNodeOptions;

static PyObject *__pyx_tp_new_7pyarrow_8_dataset__ScanNodeOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions*)__pyx_vtabptr_7pyarrow_8_dataset__ScanNodeOptions;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset__ScanNodeOptions(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset__ScanNodeOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_8_dataset__ScanNodeOptions);
}

static PyMethodDef __pyx_methods_7pyarrow_8_dataset__ScanNodeOptions[] = {
  {"_set_options", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions__set_options},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_8_dataset_16_ScanNodeOptions_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset__ScanNodeOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset__ScanNodeOptions},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_8_dataset__ScanNodeOptions},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset__ScanNodeOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset__ScanNodeOptions_spec = {
  "pyarrow._dataset._ScanNodeOptions",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_8_dataset__ScanNodeOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset__ScanNodeOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""_ScanNodeOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset__ScanNodeOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_8_dataset__ScanNodeOptions, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset__ScanNodeOptions, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct___get_fragments(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *p;
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct___get_fragments > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct___get_fragments[--__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct___get_fragments];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)o);
  __Pyx_default_placement_construct(&(p->__pyx_v_c_filter));
  __Pyx_default_placement_construct(&(p->__pyx_v_c_fragments));
  __Pyx_default_placement_construct(&(p->__pyx_v_maybe_fragment));
  __Pyx_default_placement_construct(&(p->__pyx_t_0));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct___get_fragments(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *p = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct___get_fragments) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_v_c_filter);
  __Pyx_call_destructor(p->__pyx_v_c_fragments);
  __Pyx_call_destructor(p->__pyx_v_maybe_fragment);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_filter);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct___get_fragments < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct___get_fragments[__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct___get_fragments++] = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7pyarrow_8_dataset___pyx_scope_struct___get_fragments(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *p = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_filter) {
    e = (*v)(((PyObject *)p->__pyx_v_filter), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct___get_fragments},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset___pyx_scope_struct___get_fragments},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct___get_fragments},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments_spec = {
  "pyarrow._dataset.__pyx_scope_struct___get_fragments",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""__pyx_scope_struct___get_fragments", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct___get_fragments), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct___get_fragments, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_8_dataset___pyx_scope_struct___get_fragments, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct___get_fragments, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct_1__iterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct_1__iterator > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct_1__iterator[--__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct_1__iterator];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct_1__iterator(PyObject *o) {
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *p = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct_1__iterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_batch);
  Py_CLEAR(p->__pyx_v_batch_iter);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct_1__iterator < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator, sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_8_dataset___pyx_scope_struct_1__iterator[__pyx_mstate_global->__pyx_freecount_7pyarrow_8_dataset___pyx_scope_struct_1__iterator++] = ((struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7pyarrow_8_dataset___pyx_scope_struct_1__iterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *p = (struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_batch) {
    e = (*v)(p->__pyx_v_batch, a); if (e) return e;
  }
  if (p->__pyx_v_batch_iter) {
    e = (*v)(p->__pyx_v_batch_iter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct_1__iterator},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_8_dataset___pyx_scope_struct_1__iterator},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct_1__iterator},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator_spec = {
  "pyarrow._dataset.__pyx_scope_struct_1__iterator",
  sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._dataset.""__pyx_scope_struct_1__iterator", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_8_dataset___pyx_scope_struct_1__iterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_8_dataset___pyx_scope_struct_1__iterator, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_8_dataset___pyx_scope_struct_1__iterator, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_8_dataset___pyx_scope_struct_1__iterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_7pyarrow_8_dataset__true = ((struct __pyx_obj_7pyarrow_8_compute_Expression *)Py_None); Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  {
    __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_arrow_dataset_FileSource_PyObjec);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_export_name = __pyx_export_signature + 121;
    void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_7pyarrow_8_dataset__make_file_source, (void (*)(void)) NULL};
    void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers;
    const char *__pyx_export_current_signature = __pyx_export_signature;
    while (*__pyx_export_pointer) {
      if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_export_pointer;
      __pyx_export_name = strchr(__pyx_export_name, '\0') + 1;
      __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1;
      if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_signature;
    }
    __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_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Weakrefable = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Weakrefable",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Weakrefable) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory = &__pyx_vtable_7pyarrow_8_dataset_DatasetFactory;
  __pyx_vtable_7pyarrow_8_dataset_DatasetFactory.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *, std::shared_ptr<arrow::dataset::DatasetFactory>  const &))__pyx_f_7pyarrow_8_dataset_14DatasetFactory_init;
  __pyx_vtable_7pyarrow_8_dataset_DatasetFactory.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::DatasetFactory>  const &))__pyx_f_7pyarrow_8_dataset_14DatasetFactory_wrap;
  __pyx_vtable_7pyarrow_8_dataset_DatasetFactory.unwrap = (std::shared_ptr<arrow::dataset::DatasetFactory>  (*)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *))__pyx_f_7pyarrow_8_dataset_14DatasetFactory_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_DatasetFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory)) __PYX_ERR(0, 3121, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_DatasetFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory = &__pyx_type_7pyarrow_8_dataset_DatasetFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory, __pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DatasetFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory) < (0)) __PYX_ERR(0, 3121, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_Dataset = &__pyx_vtable_7pyarrow_8_dataset_Dataset;
  __pyx_vtable_7pyarrow_8_dataset_Dataset.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, std::shared_ptr<arrow::dataset::Dataset>  const &))__pyx_f_7pyarrow_8_dataset_7Dataset_init;
  __pyx_vtable_7pyarrow_8_dataset_Dataset.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::Dataset>  const &))__pyx_f_7pyarrow_8_dataset_7Dataset_wrap;
  __pyx_vtable_7pyarrow_8_dataset_Dataset.unwrap = (std::shared_ptr<arrow::dataset::Dataset>  (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *))__pyx_f_7pyarrow_8_dataset_7Dataset_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_Dataset_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset)) __PYX_ERR(0, 162, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_Dataset_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset = &__pyx_type_7pyarrow_8_dataset_Dataset;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_vtabptr_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Dataset, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_Dataset, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Dataset) < (0)) __PYX_ERR(0, 162, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_Scanner = &__pyx_vtable_7pyarrow_8_dataset_Scanner;
  __pyx_vtable_7pyarrow_8_dataset_Scanner.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Scanner *, std::shared_ptr<arrow::dataset::Scanner>  const &))__pyx_f_7pyarrow_8_dataset_7Scanner_init;
  __pyx_vtable_7pyarrow_8_dataset_Scanner.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::Scanner>  const &))__pyx_f_7pyarrow_8_dataset_7Scanner_wrap;
  __pyx_vtable_7pyarrow_8_dataset_Scanner.unwrap = (std::shared_ptr<arrow::dataset::Scanner>  (*)(struct __pyx_obj_7pyarrow_8_dataset_Scanner *))__pyx_f_7pyarrow_8_dataset_7Scanner_unwrap;
  __pyx_vtable_7pyarrow_8_dataset_Scanner._make_scan_options = (std::shared_ptr<arrow::dataset::ScanOptions>  (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, PyObject *))__pyx_f_7pyarrow_8_dataset_7Scanner__make_scan_options;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_Scanner_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner)) __PYX_ERR(0, 3585, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_Scanner_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner = &__pyx_type_7pyarrow_8_dataset_Scanner;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_vtabptr_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Scanner, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_Scanner, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Scanner) < (0)) __PYX_ERR(0, 3585, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions = &__pyx_vtable_7pyarrow_8_dataset_FragmentScanOptions;
  __pyx_vtable_7pyarrow_8_dataset_FragmentScanOptions.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &))__pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_init;
  __pyx_vtable_7pyarrow_8_dataset_FragmentScanOptions.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &))__pyx_f_7pyarrow_8_dataset_19FragmentScanOptions_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FragmentScanOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions)) __PYX_ERR(0, 2078, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FragmentScanOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions = &__pyx_type_7pyarrow_8_dataset_FragmentScanOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions, __pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FragmentScanOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions) < (0)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_FileFormat = &__pyx_vtable_7pyarrow_8_dataset_FileFormat;
  __pyx_vtable_7pyarrow_8_dataset_FileFormat.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, std::shared_ptr<arrow::dataset::FileFormat>  const &))__pyx_f_7pyarrow_8_dataset_10FileFormat_init;
  __pyx_vtable_7pyarrow_8_dataset_FileFormat.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::FileFormat>  const &))__pyx_f_7pyarrow_8_dataset_10FileFormat_wrap;
  __pyx_vtable_7pyarrow_8_dataset_FileFormat.unwrap = (std::shared_ptr<arrow::dataset::FileFormat>  (*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *))__pyx_f_7pyarrow_8_dataset_10FileFormat_unwrap;
  __pyx_vtable_7pyarrow_8_dataset_FileFormat._set_default_fragment_scan_options = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *))__pyx_f_7pyarrow_8_dataset_10FileFormat__set_default_fragment_scan_options;
  __pyx_vtable_7pyarrow_8_dataset_FileFormat._finish_write = (struct __pyx_obj_7pyarrow_8_dataset_WrittenFile *(*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, PyObject *, PyObject *, arrow::dataset::FileWriter *))__pyx_f_7pyarrow_8_dataset_10FileFormat__finish_write;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileFormat_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat)) __PYX_ERR(0, 1293, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileFormat_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat = &__pyx_type_7pyarrow_8_dataset_FileFormat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat, __pyx_vtabptr_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileFormat, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileFormat, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFormat) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions = &__pyx_vtable_7pyarrow_8_dataset_FileWriteOptions;
  __pyx_vtable_7pyarrow_8_dataset_FileWriteOptions.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &))__pyx_f_7pyarrow_8_dataset_16FileWriteOptions_init;
  __pyx_vtable_7pyarrow_8_dataset_FileWriteOptions.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::FileWriteOptions>  const &))__pyx_f_7pyarrow_8_dataset_16FileWriteOptions_wrap;
  __pyx_vtable_7pyarrow_8_dataset_FileWriteOptions.unwrap = (std::shared_ptr<arrow::dataset::FileWriteOptions>  (*)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *))__pyx_f_7pyarrow_8_dataset_16FileWriteOptions_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileWriteOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions)) __PYX_ERR(0, 1258, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileWriteOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions = &__pyx_type_7pyarrow_8_dataset_FileWriteOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions, __pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileWriteOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions) < (0)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_Fragment = &__pyx_vtable_7pyarrow_8_dataset_Fragment;
  __pyx_vtable_7pyarrow_8_dataset_Fragment.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Fragment *, std::shared_ptr<arrow::dataset::Fragment>  const &))__pyx_f_7pyarrow_8_dataset_8Fragment_init;
  __pyx_vtable_7pyarrow_8_dataset_Fragment.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::Fragment>  const &))__pyx_f_7pyarrow_8_dataset_8Fragment_wrap;
  __pyx_vtable_7pyarrow_8_dataset_Fragment.unwrap = (std::shared_ptr<arrow::dataset::Fragment>  (*)(struct __pyx_obj_7pyarrow_8_dataset_Fragment *))__pyx_f_7pyarrow_8_dataset_8Fragment_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_Fragment_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment)) __PYX_ERR(0, 1434, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_Fragment_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment = &__pyx_type_7pyarrow_8_dataset_Fragment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_vtabptr_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Fragment, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_Fragment, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Fragment) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_FileFragment = &__pyx_vtable_7pyarrow_8_dataset_FileFragment;
  __pyx_vtable_7pyarrow_8_dataset_FileFragment.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_Fragment;
  __pyx_vtable_7pyarrow_8_dataset_FileFragment.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Fragment *, std::shared_ptr<arrow::dataset::Fragment>  const &))__pyx_f_7pyarrow_8_dataset_12FileFragment_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileFragment_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment)) __PYX_ERR(0, 1975, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileFragment_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment) < (0)) __PYX_ERR(0, 1975, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment = &__pyx_type_7pyarrow_8_dataset_FileFragment;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment) < (0)) __PYX_ERR(0, 1975, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment, __pyx_vtabptr_7pyarrow_8_dataset_FileFragment) < (0)) __PYX_ERR(0, 1975, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment) < (0)) __PYX_ERR(0, 1975, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileFragment, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment) < (0)) __PYX_ERR(0, 1975, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileFragment->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileFragment, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_Partitioning = &__pyx_vtable_7pyarrow_8_dataset_Partitioning;
  __pyx_vtable_7pyarrow_8_dataset_Partitioning.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_12Partitioning_init;
  __pyx_vtable_7pyarrow_8_dataset_Partitioning.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_12Partitioning_wrap;
  __pyx_vtable_7pyarrow_8_dataset_Partitioning.unwrap = (std::shared_ptr<arrow::dataset::Partitioning>  (*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *))__pyx_f_7pyarrow_8_dataset_12Partitioning_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_Partitioning_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning)) __PYX_ERR(0, 2536, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_Partitioning_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning = &__pyx_type_7pyarrow_8_dataset_Partitioning;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning, __pyx_vtabptr_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Partitioning, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_Partitioning, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_Partitioning) < (0)) __PYX_ERR(0, 2536, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_PartitioningFactory = &__pyx_vtable_7pyarrow_8_dataset_PartitioningFactory;
  __pyx_vtable_7pyarrow_8_dataset_PartitioningFactory.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *, std::shared_ptr<arrow::dataset::PartitioningFactory>  const &))__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_init;
  __pyx_vtable_7pyarrow_8_dataset_PartitioningFactory.wrap = (PyObject *(*)(std::shared_ptr<arrow::dataset::PartitioningFactory>  const &, PyObject *, PyObject *))__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_wrap;
  __pyx_vtable_7pyarrow_8_dataset_PartitioningFactory.unwrap = (std::shared_ptr<arrow::dataset::PartitioningFactory>  (*)(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory *))__pyx_f_7pyarrow_8_dataset_19PartitioningFactory_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_PartitioningFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory)) __PYX_ERR(0, 2630, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_PartitioningFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory) < (0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory = &__pyx_type_7pyarrow_8_dataset_PartitioningFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory) < (0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory, __pyx_vtabptr_7pyarrow_8_dataset_PartitioningFactory) < (0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory) < (0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PartitioningFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory) < (0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_PartitioningFactory, __pyx_base.__weakref__);
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_WrittenFile_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile)) __PYX_ERR(0, 4080, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_WrittenFile_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile) < (0)) __PYX_ERR(0, 4080, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile = &__pyx_type_7pyarrow_8_dataset_WrittenFile;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile) < (0)) __PYX_ERR(0, 4080, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_WrittenFile, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile) < (0)) __PYX_ERR(0, 4080, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_WrittenFile, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_WrittenFile) < (0)) __PYX_ERR(0, 4080, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_InMemoryDataset = &__pyx_vtable_7pyarrow_8_dataset_InMemoryDataset;
  __pyx_vtable_7pyarrow_8_dataset_InMemoryDataset.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_Dataset;
  __pyx_vtable_7pyarrow_8_dataset_InMemoryDataset.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, std::shared_ptr<arrow::dataset::Dataset>  const &))__pyx_f_7pyarrow_8_dataset_15InMemoryDataset_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_InMemoryDataset_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset)) __PYX_ERR(0, 994, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_InMemoryDataset_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset = &__pyx_type_7pyarrow_8_dataset_InMemoryDataset;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset, __pyx_vtabptr_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_InMemoryDataset, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_InMemoryDataset, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_InMemoryDataset) < (0)) __PYX_ERR(0, 994, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_UnionDataset = &__pyx_vtable_7pyarrow_8_dataset_UnionDataset;
  __pyx_vtable_7pyarrow_8_dataset_UnionDataset.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_Dataset;
  __pyx_vtable_7pyarrow_8_dataset_UnionDataset.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, std::shared_ptr<arrow::dataset::Dataset>  const &))__pyx_f_7pyarrow_8_dataset_12UnionDataset_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_UnionDataset_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset)) __PYX_ERR(0, 1055, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_UnionDataset_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset = &__pyx_type_7pyarrow_8_dataset_UnionDataset;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset, __pyx_vtabptr_7pyarrow_8_dataset_UnionDataset) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_UnionDataset, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset) < (0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDataset->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_UnionDataset, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_FileSystemDataset = &__pyx_vtable_7pyarrow_8_dataset_FileSystemDataset;
  __pyx_vtable_7pyarrow_8_dataset_FileSystemDataset.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_Dataset;
  __pyx_vtable_7pyarrow_8_dataset_FileSystemDataset.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_Dataset *, std::shared_ptr<arrow::dataset::Dataset>  const &))__pyx_f_7pyarrow_8_dataset_17FileSystemDataset_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileSystemDataset_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset)) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileSystemDataset_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset) < (0)) __PYX_ERR(0, 1098, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset = &__pyx_type_7pyarrow_8_dataset_FileSystemDataset;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset) < (0)) __PYX_ERR(0, 1098, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_vtabptr_7pyarrow_8_dataset_FileSystemDataset) < (0)) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset) < (0)) __PYX_ERR(0, 1098, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileSystemDataset, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset) < (0)) __PYX_ERR(0, 1098, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDataset, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_IpcFileWriteOptions = &__pyx_vtable_7pyarrow_8_dataset_IpcFileWriteOptions;
  __pyx_vtable_7pyarrow_8_dataset_IpcFileWriteOptions.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions;
  __pyx_vtable_7pyarrow_8_dataset_IpcFileWriteOptions.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &))__pyx_f_7pyarrow_8_dataset_19IpcFileWriteOptions_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions)) __PYX_ERR(0, 2119, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions = &__pyx_type_7pyarrow_8_dataset_IpcFileWriteOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions, __pyx_vtabptr_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_IpcFileWriteOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileWriteOptions, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileWriteOptions) < (0)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_IpcFileFormat = &__pyx_vtable_7pyarrow_8_dataset_IpcFileFormat;
  __pyx_vtable_7pyarrow_8_dataset_IpcFileFormat.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FileFormat;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_IpcFileFormat_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat)) __PYX_ERR(0, 2142, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_IpcFileFormat_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat) < (0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat = &__pyx_type_7pyarrow_8_dataset_IpcFileFormat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat) < (0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat, __pyx_vtabptr_7pyarrow_8_dataset_IpcFileFormat) < (0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat) < (0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_IpcFileFormat, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat) < (0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_IpcFileFormat, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_FeatherFileFormat = &__pyx_vtable_7pyarrow_8_dataset_FeatherFileFormat;
  __pyx_vtable_7pyarrow_8_dataset_FeatherFileFormat.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_IpcFileFormat;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FeatherFileFormat_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat)) __PYX_ERR(0, 2182, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FeatherFileFormat_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat) < (0)) __PYX_ERR(0, 2182, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat = &__pyx_type_7pyarrow_8_dataset_FeatherFileFormat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat) < (0)) __PYX_ERR(0, 2182, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat, __pyx_vtabptr_7pyarrow_8_dataset_FeatherFileFormat) < (0)) __PYX_ERR(0, 2182, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat) < (0)) __PYX_ERR(0, 2182, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FeatherFileFormat, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat) < (0)) __PYX_ERR(0, 2182, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FeatherFileFormat->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FeatherFileFormat, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_CsvFileFormat = &__pyx_vtable_7pyarrow_8_dataset_CsvFileFormat;
  __pyx_vtable_7pyarrow_8_dataset_CsvFileFormat.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FileFormat;
  __pyx_vtable_7pyarrow_8_dataset_CsvFileFormat.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, std::shared_ptr<arrow::dataset::FileFormat>  const &))__pyx_f_7pyarrow_8_dataset_13CsvFileFormat_init;
  __pyx_vtable_7pyarrow_8_dataset_CsvFileFormat.__pyx_base._set_default_fragment_scan_options = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *))__pyx_f_7pyarrow_8_dataset_13CsvFileFormat__set_default_fragment_scan_options;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_CsvFileFormat_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat)) __PYX_ERR(0, 2189, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_CsvFileFormat_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat) < (0)) __PYX_ERR(0, 2189, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat = &__pyx_type_7pyarrow_8_dataset_CsvFileFormat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat) < (0)) __PYX_ERR(0, 2189, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, __pyx_vtabptr_7pyarrow_8_dataset_CsvFileFormat) < (0)) __PYX_ERR(0, 2189, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat) < (0)) __PYX_ERR(0, 2189, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CsvFileFormat, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat) < (0)) __PYX_ERR(0, 2189, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileFormat, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_CsvFragmentScanOptions = &__pyx_vtable_7pyarrow_8_dataset_CsvFragmentScanOptions;
  __pyx_vtable_7pyarrow_8_dataset_CsvFragmentScanOptions.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions;
  __pyx_vtable_7pyarrow_8_dataset_CsvFragmentScanOptions.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &))__pyx_f_7pyarrow_8_dataset_22CsvFragmentScanOptions_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions)) __PYX_ERR(0, 2298, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions) < (0)) __PYX_ERR(0, 2298, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions = &__pyx_type_7pyarrow_8_dataset_CsvFragmentScanOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions) < (0)) __PYX_ERR(0, 2298, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_vtabptr_7pyarrow_8_dataset_CsvFragmentScanOptions) < (0)) __PYX_ERR(0, 2298, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions) < (0)) __PYX_ERR(0, 2298, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CsvFragmentScanOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions) < (0)) __PYX_ERR(0, 2298, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_CsvFileWriteOptions = &__pyx_vtable_7pyarrow_8_dataset_CsvFileWriteOptions;
  __pyx_vtable_7pyarrow_8_dataset_CsvFileWriteOptions.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FileWriteOptions;
  __pyx_vtable_7pyarrow_8_dataset_CsvFileWriteOptions.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileWriteOptions *, std::shared_ptr<arrow::dataset::FileWriteOptions>  const &))__pyx_f_7pyarrow_8_dataset_19CsvFileWriteOptions_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions)) __PYX_ERR(0, 2376, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions = &__pyx_type_7pyarrow_8_dataset_CsvFileWriteOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileWriteOptions;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions, __pyx_vtabptr_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CsvFileWriteOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_CsvFileWriteOptions, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_CsvFileWriteOptions) < (0)) __PYX_ERR(0, 2376, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_JsonFileFormat = &__pyx_vtable_7pyarrow_8_dataset_JsonFileFormat;
  __pyx_vtable_7pyarrow_8_dataset_JsonFileFormat.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FileFormat;
  __pyx_vtable_7pyarrow_8_dataset_JsonFileFormat.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, std::shared_ptr<arrow::dataset::FileFormat>  const &))__pyx_f_7pyarrow_8_dataset_14JsonFileFormat_init;
  __pyx_vtable_7pyarrow_8_dataset_JsonFileFormat.__pyx_base._set_default_fragment_scan_options = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_FileFormat *, struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *))__pyx_f_7pyarrow_8_dataset_14JsonFileFormat__set_default_fragment_scan_options;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_JsonFileFormat_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat)) __PYX_ERR(0, 2398, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_JsonFileFormat_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat) < (0)) __PYX_ERR(0, 2398, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat = &__pyx_type_7pyarrow_8_dataset_JsonFileFormat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat) < (0)) __PYX_ERR(0, 2398, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat, __pyx_vtabptr_7pyarrow_8_dataset_JsonFileFormat) < (0)) __PYX_ERR(0, 2398, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat) < (0)) __PYX_ERR(0, 2398, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_JsonFileFormat_2, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat) < (0)) __PYX_ERR(0, 2398, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_JsonFileFormat, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_JsonFragmentScanOptions = &__pyx_vtable_7pyarrow_8_dataset_JsonFragmentScanOptions;
  __pyx_vtable_7pyarrow_8_dataset_JsonFragmentScanOptions.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_FragmentScanOptions;
  __pyx_vtable_7pyarrow_8_dataset_JsonFragmentScanOptions.__pyx_base.init = (void (*)(struct __pyx_obj_7pyarrow_8_dataset_FragmentScanOptions *, std::shared_ptr<arrow::dataset::FragmentScanOptions>  const &))__pyx_f_7pyarrow_8_dataset_23JsonFragmentScanOptions_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions)) __PYX_ERR(0, 2471, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions) < (0)) __PYX_ERR(0, 2471, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions = &__pyx_type_7pyarrow_8_dataset_JsonFragmentScanOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FragmentScanOptions;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions) < (0)) __PYX_ERR(0, 2471, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_vtabptr_7pyarrow_8_dataset_JsonFragmentScanOptions) < (0)) __PYX_ERR(0, 2471, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions) < (0)) __PYX_ERR(0, 2471, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_JsonFragmentScanOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions) < (0)) __PYX_ERR(0, 2471, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning = &__pyx_vtable_7pyarrow_8_dataset_KeyValuePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_KeyValuePartitioning.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_Partitioning;
  __pyx_vtable_7pyarrow_8_dataset_KeyValuePartitioning.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_20KeyValuePartitioning_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning)) __PYX_ERR(0, 2680, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning) < (0)) __PYX_ERR(0, 2680, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning = &__pyx_type_7pyarrow_8_dataset_KeyValuePartitioning;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning) < (0)) __PYX_ERR(0, 2680, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning, __pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning) < (0)) __PYX_ERR(0, 2680, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning) < (0)) __PYX_ERR(0, 2680, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KeyValuePartitioning, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning) < (0)) __PYX_ERR(0, 2680, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_KeyValuePartitioning, __pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_DirectoryPartitioning = &__pyx_vtable_7pyarrow_8_dataset_DirectoryPartitioning;
  __pyx_vtable_7pyarrow_8_dataset_DirectoryPartitioning.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_DirectoryPartitioning.__pyx_base.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_21DirectoryPartitioning_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning)) __PYX_ERR(0, 2730, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning) < (0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning = &__pyx_type_7pyarrow_8_dataset_DirectoryPartitioning;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning) < (0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning, __pyx_vtabptr_7pyarrow_8_dataset_DirectoryPartitioning) < (0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning) < (0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DirectoryPartitioning, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning) < (0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_DirectoryPartitioning, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_HivePartitioning = &__pyx_vtable_7pyarrow_8_dataset_HivePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_HivePartitioning.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_HivePartitioning.__pyx_base.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_16HivePartitioning_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_HivePartitioning_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning)) __PYX_ERR(0, 2858, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_HivePartitioning_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning) < (0)) __PYX_ERR(0, 2858, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning = &__pyx_type_7pyarrow_8_dataset_HivePartitioning;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning) < (0)) __PYX_ERR(0, 2858, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning, __pyx_vtabptr_7pyarrow_8_dataset_HivePartitioning) < (0)) __PYX_ERR(0, 2858, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning) < (0)) __PYX_ERR(0, 2858, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_HivePartitioning, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning) < (0)) __PYX_ERR(0, 2858, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_HivePartitioning, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_FilenamePartitioning = &__pyx_vtable_7pyarrow_8_dataset_FilenamePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_FilenamePartitioning.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_KeyValuePartitioning;
  __pyx_vtable_7pyarrow_8_dataset_FilenamePartitioning.__pyx_base.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_Partitioning *, std::shared_ptr<arrow::dataset::Partitioning>  const &))__pyx_f_7pyarrow_8_dataset_20FilenamePartitioning_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FilenamePartitioning_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning)) __PYX_ERR(0, 3009, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FilenamePartitioning_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning) < (0)) __PYX_ERR(0, 3009, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning = &__pyx_type_7pyarrow_8_dataset_FilenamePartitioning;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning) < (0)) __PYX_ERR(0, 3009, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning, __pyx_vtabptr_7pyarrow_8_dataset_FilenamePartitioning) < (0)) __PYX_ERR(0, 3009, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning) < (0)) __PYX_ERR(0, 3009, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FilenamePartitioning, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning) < (0)) __PYX_ERR(0, 3009, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FilenamePartitioning, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_7pyarrow_8_dataset_FileSystemFactoryOptions = &__pyx_vtable_7pyarrow_8_dataset_FileSystemFactoryOptions;
  __pyx_vtable_7pyarrow_8_dataset_FileSystemFactoryOptions.unwrap = (arrow::dataset::FileSystemFactoryOptions (*)(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions *))__pyx_f_7pyarrow_8_dataset_24FileSystemFactoryOptions_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions)) __PYX_ERR(0, 3229, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions = &__pyx_type_7pyarrow_8_dataset_FileSystemFactoryOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions, __pyx_vtabptr_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileSystemFactoryOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemFactoryOptions, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions) < (0)) __PYX_ERR(0, 3229, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_FileSystemDatasetFactory = &__pyx_vtable_7pyarrow_8_dataset_FileSystemDatasetFactory;
  __pyx_vtable_7pyarrow_8_dataset_FileSystemDatasetFactory.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory;
  __pyx_vtable_7pyarrow_8_dataset_FileSystemDatasetFactory.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *, std::shared_ptr<arrow::dataset::DatasetFactory>  const &))__pyx_f_7pyarrow_8_dataset_24FileSystemDatasetFactory_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory)) __PYX_ERR(0, 3350, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory = &__pyx_type_7pyarrow_8_dataset_FileSystemDatasetFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory, __pyx_vtabptr_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FileSystemDatasetFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_FileSystemDatasetFactory, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_FileSystemDatasetFactory) < (0)) __PYX_ERR(0, 3350, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_UnionDatasetFactory = &__pyx_vtable_7pyarrow_8_dataset_UnionDatasetFactory;
  __pyx_vtable_7pyarrow_8_dataset_UnionDatasetFactory.__pyx_base = *__pyx_vtabptr_7pyarrow_8_dataset_DatasetFactory;
  __pyx_vtable_7pyarrow_8_dataset_UnionDatasetFactory.__pyx_base.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_8_dataset_DatasetFactory *, std::shared_ptr<arrow::dataset::DatasetFactory>  const &))__pyx_f_7pyarrow_8_dataset_19UnionDatasetFactory_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory)) __PYX_ERR(0, 3425, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory = &__pyx_type_7pyarrow_8_dataset_UnionDatasetFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory, __pyx_vtabptr_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_UnionDatasetFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_UnionDatasetFactory, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_UnionDatasetFactory) < (0)) __PYX_ERR(0, 3425, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_RecordBatchIterator = &__pyx_vtable_7pyarrow_8_dataset_RecordBatchIterator;
  __pyx_vtable_7pyarrow_8_dataset_RecordBatchIterator.wrap = (PyObject *(*)(PyObject *, arrow::RecordBatchIterator))__pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_wrap;
  __pyx_vtable_7pyarrow_8_dataset_RecordBatchIterator.unwrap = (std::shared_ptr<arrow::RecordBatchIterator>  (*)(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator *))__pyx_f_7pyarrow_8_dataset_19RecordBatchIterator_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_RecordBatchIterator_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator)) __PYX_ERR(0, 3451, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_RecordBatchIterator_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator = &__pyx_type_7pyarrow_8_dataset_RecordBatchIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator, __pyx_vtabptr_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_RecordBatchIterator, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_RecordBatchIterator, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_RecordBatchIterator) < (0)) __PYX_ERR(0, 3451, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset_TaggedRecordBatchIterator = &__pyx_vtable_7pyarrow_8_dataset_TaggedRecordBatchIterator;
  __pyx_vtable_7pyarrow_8_dataset_TaggedRecordBatchIterator.wrap = (PyObject *(*)(PyObject *, arrow::dataset::TaggedRecordBatchIterator))__pyx_f_7pyarrow_8_dataset_25TaggedRecordBatchIterator_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator)) __PYX_ERR(0, 3500, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator = &__pyx_type_7pyarrow_8_dataset_TaggedRecordBatchIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator, __pyx_vtabptr_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatchIterator, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset_TaggedRecordBatchIterator, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset_TaggedRecordBatchIterator) < (0)) __PYX_ERR(0, 3500, __pyx_L1_error)
  __pyx_t_2 = PyImport_ImportModule("pyarrow._acero"); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions = __Pyx_ImportType_3_2_4(__pyx_t_2, "pyarrow._acero", "ExecNodeOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_ExecNodeOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_6_acero_ExecNodeOptions = (struct __pyx_vtabstruct_7pyarrow_6_acero_ExecNodeOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_6_acero_ExecNodeOptions)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_dataset__ScanNodeOptions = &__pyx_vtable_7pyarrow_8_dataset__ScanNodeOptions;
  __pyx_vtable_7pyarrow_8_dataset__ScanNodeOptions.__pyx_base = *__pyx_vtabptr_7pyarrow_6_acero_ExecNodeOptions;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_3 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset__ScanNodeOptions_spec, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions)) __PYX_ERR(0, 4180, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset__ScanNodeOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions = &__pyx_type_7pyarrow_8_dataset__ScanNodeOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_6_acero_ExecNodeOptions;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions, __pyx_vtabptr_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_8_dataset__ScanNodeOptions, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions) < (0)) __PYX_ERR(0, 4180, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments)) __PYX_ERR(0, 256, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments) < (0)) __PYX_ERR(0, 256, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments = &__pyx_type_7pyarrow_8_dataset___pyx_scope_struct___get_fragments;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments) < (0)) __PYX_ERR(0, 256, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct___get_fragments->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator)) __PYX_ERR(0, 3933, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator_spec, __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator) < (0)) __PYX_ERR(0, 3933, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator = &__pyx_type_7pyarrow_8_dataset___pyx_scope_struct_1__iterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator) < (0)) __PYX_ERR(0, 3933, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_8_dataset___pyx_scope_struct_1__iterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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(5, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 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(6, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(6, 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(7, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(7, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "date",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #else
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(3, 43, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "time",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #else
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(3, 56, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "datetime",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #else
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(3, 82, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "timedelta",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #else
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(3, 120, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "tzinfo",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #else
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(3, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IpcWriteOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions) __PYX_ERR(8, 41, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcReadOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IpcReadOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcReadOptions) __PYX_ERR(8, 49, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Message = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Message",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Message) __PYX_ERR(8, 60, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MemoryPool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool) __PYX_ERR(8, 65, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MemoryPool = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MemoryPool)) __PYX_ERR(8, 65, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DataType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType) __PYX_ERR(8, 78, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DataType = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DataType)) __PYX_ERR(8, 78, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType) __PYX_ERR(8, 88, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListType = (struct __pyx_vtabstruct_7pyarrow_3lib_ListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListType)) __PYX_ERR(8, 88, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType) __PYX_ERR(8, 93, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListType = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListType)) __PYX_ERR(8, 93, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListViewType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType) __PYX_ERR(8, 98, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListViewType = (struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListViewType)) __PYX_ERR(8, 98, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListViewType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType) __PYX_ERR(8, 103, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListViewType = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListViewType)) __PYX_ERR(8, 103, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MapType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType) __PYX_ERR(8, 108, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MapType = (struct __pyx_vtabstruct_7pyarrow_3lib_MapType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MapType)) __PYX_ERR(8, 108, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType) __PYX_ERR(8, 113, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeListType)) __PYX_ERR(8, 113, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StructType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType) __PYX_ERR(8, 118, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StructType = (struct __pyx_vtabstruct_7pyarrow_3lib_StructType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StructType)) __PYX_ERR(8, 118, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryMemo = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryMemo",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryMemo) __PYX_ERR(8, 125, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType) __PYX_ERR(8, 133, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DictionaryType = (struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DictionaryType)) __PYX_ERR(8, 133, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "TimestampType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType) __PYX_ERR(8, 138, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_TimestampType = (struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_TimestampType)) __PYX_ERR(8, 138, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Time32Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type) __PYX_ERR(8, 143, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Time32Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Time32Type)) __PYX_ERR(8, 143, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Time64Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type) __PYX_ERR(8, 148, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Time64Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Time64Type)) __PYX_ERR(8, 148, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DurationType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType) __PYX_ERR(8, 153, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DurationType = (struct __pyx_vtabstruct_7pyarrow_3lib_DurationType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DurationType)) __PYX_ERR(8, 153, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeBinaryType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType) __PYX_ERR(8, 158, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType)) __PYX_ERR(8, 158, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal32Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type) __PYX_ERR(8, 163, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal32Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal32Type)) __PYX_ERR(8, 163, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal64Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type) __PYX_ERR(8, 168, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal64Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal64Type)) __PYX_ERR(8, 168, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal128Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type) __PYX_ERR(8, 173, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal128Type)) __PYX_ERR(8, 173, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal256Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type) __PYX_ERR(8, 178, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal256Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal256Type)) __PYX_ERR(8, 178, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RunEndEncodedType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType) __PYX_ERR(8, 183, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType = (struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType)) __PYX_ERR(8, 183, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BaseExtensionType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType) __PYX_ERR(8, 188, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType = (struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType)) __PYX_ERR(8, 188, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ExtensionType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType) __PYX_ERR(8, 193, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ExtensionType = (struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ExtensionType)) __PYX_ERR(8, 193, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedShapeTensorType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType) __PYX_ERR(8, 198, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType)) __PYX_ERR(8, 198, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Bool8Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type) __PYX_ERR(8, 202, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Bool8Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Bool8Type)) __PYX_ERR(8, 202, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "OpaqueType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType) __PYX_ERR(8, 206, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_OpaqueType = (struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_OpaqueType)) __PYX_ERR(8, 206, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UuidType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType) __PYX_ERR(8, 210, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UuidType = (struct __pyx_vtabstruct_7pyarrow_3lib_UuidType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UuidType)) __PYX_ERR(8, 210, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "JsonType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType) __PYX_ERR(8, 214, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_JsonType = (struct __pyx_vtabstruct_7pyarrow_3lib_JsonType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_JsonType)) __PYX_ERR(8, 214, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Metadata = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Metadata",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Metadata) __PYX_ERR(8, 219, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "KeyValueMetadata",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata) __PYX_ERR(8, 225, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata = (struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata)) __PYX_ERR(8, 225, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Field",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field) __PYX_ERR(8, 237, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Field = (struct __pyx_vtabstruct_7pyarrow_3lib_Field*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Field)) __PYX_ERR(8, 237, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Schema",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema) __PYX_ERR(8, 248, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Schema = (struct __pyx_vtabstruct_7pyarrow_3lib_Schema*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Schema)) __PYX_ERR(8, 248, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Scalar",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar) __PYX_ERR(8, 257, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Scalar = (struct __pyx_vtabstruct_7pyarrow_3lib_Scalar*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Scalar)) __PYX_ERR(8, 257, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ArrayStatistics",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics) __PYX_ERR(8, 269, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ArrayStatistics = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ArrayStatistics)) __PYX_ERR(8, 269, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__PandasConvertible = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_PandasConvertible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__PandasConvertible) __PYX_ERR(8, 277, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array) __PYX_ERR(8, 281, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Array)) __PYX_ERR(8, 281, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Tensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor) __PYX_ERR(8, 297, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Tensor = (struct __pyx_vtabstruct_7pyarrow_3lib_Tensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Tensor)) __PYX_ERR(8, 297, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSRMatrix",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix) __PYX_ERR(8, 310, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix)) __PYX_ERR(8, 310, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSCMatrix",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix) __PYX_ERR(8, 321, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix)) __PYX_ERR(8, 321, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCOOTensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor) __PYX_ERR(8, 332, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor)) __PYX_ERR(8, 332, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSFTensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor) __PYX_ERR(8, 343, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor)) __PYX_ERR(8, 343, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NullArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray) __PYX_ERR(8, 354, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NullArray = (struct __pyx_vtabstruct_7pyarrow_3lib_NullArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NullArray)) __PYX_ERR(8, 354, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BooleanArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray) __PYX_ERR(8, 358, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BooleanArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BooleanArray)) __PYX_ERR(8, 358, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NumericArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray) __PYX_ERR(8, 362, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NumericArray = (struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NumericArray)) __PYX_ERR(8, 362, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IntegerArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray) __PYX_ERR(8, 366, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_IntegerArray = (struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_IntegerArray)) __PYX_ERR(8, 366, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FloatingPointArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray) __PYX_ERR(8, 370, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray)) __PYX_ERR(8, 370, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int8Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array) __PYX_ERR(8, 374, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int8Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int8Array)) __PYX_ERR(8, 374, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt8Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array) __PYX_ERR(8, 378, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt8Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt8Array)) __PYX_ERR(8, 378, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int16Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array) __PYX_ERR(8, 382, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int16Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int16Array)) __PYX_ERR(8, 382, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt16Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array) __PYX_ERR(8, 386, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt16Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt16Array)) __PYX_ERR(8, 386, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array) __PYX_ERR(8, 390, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int32Array)) __PYX_ERR(8, 390, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array) __PYX_ERR(8, 394, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt32Array)) __PYX_ERR(8, 394, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array) __PYX_ERR(8, 398, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int64Array)) __PYX_ERR(8, 398, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array) __PYX_ERR(8, 402, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt64Array)) __PYX_ERR(8, 402, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "HalfFloatArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray) __PYX_ERR(8, 406, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray = (struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray)) __PYX_ERR(8, 406, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FloatArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray) __PYX_ERR(8, 410, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FloatArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FloatArray)) __PYX_ERR(8, 410, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DoubleArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray) __PYX_ERR(8, 414, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DoubleArray = (struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DoubleArray)) __PYX_ERR(8, 414, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeBinaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray) __PYX_ERR(8, 418, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray)) __PYX_ERR(8, 418, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array) __PYX_ERR(8, 422, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal32Array)) __PYX_ERR(8, 422, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array) __PYX_ERR(8, 426, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal64Array)) __PYX_ERR(8, 426, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal128Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array) __PYX_ERR(8, 430, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal128Array)) __PYX_ERR(8, 430, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal256Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array) __PYX_ERR(8, 434, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal256Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal256Array)) __PYX_ERR(8, 434, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StructArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray) __PYX_ERR(8, 438, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StructArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StructArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StructArray)) __PYX_ERR(8, 438, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BaseListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray) __PYX_ERR(8, 442, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BaseListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BaseListArray)) __PYX_ERR(8, 442, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray) __PYX_ERR(8, 446, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListArray)) __PYX_ERR(8, 446, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray) __PYX_ERR(8, 450, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListArray)) __PYX_ERR(8, 450, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray) __PYX_ERR(8, 454, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListViewArray)) __PYX_ERR(8, 454, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray) __PYX_ERR(8, 458, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListViewArray)) __PYX_ERR(8, 458, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MapArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray) __PYX_ERR(8, 462, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MapArray = (struct __pyx_vtabstruct_7pyarrow_3lib_MapArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MapArray)) __PYX_ERR(8, 462, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray) __PYX_ERR(8, 466, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray)) __PYX_ERR(8, 466, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UnionArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray) __PYX_ERR(8, 470, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UnionArray = (struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UnionArray)) __PYX_ERR(8, 470, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StringArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray) __PYX_ERR(8, 474, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StringArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StringArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StringArray)) __PYX_ERR(8, 474, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BinaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray) __PYX_ERR(8, 478, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BinaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BinaryArray)) __PYX_ERR(8, 478, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StringViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray) __PYX_ERR(8, 482, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StringViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StringViewArray)) __PYX_ERR(8, 482, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BinaryViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray) __PYX_ERR(8, 486, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BinaryViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BinaryViewArray)) __PYX_ERR(8, 486, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray) __PYX_ERR(8, 490, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DictionaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DictionaryArray)) __PYX_ERR(8, 490, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ExtensionArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray) __PYX_ERR(8, 495, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ExtensionArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ExtensionArray)) __PYX_ERR(8, 495, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MonthDayNanoIntervalArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray) __PYX_ERR(8, 499, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray = (struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray)) __PYX_ERR(8, 499, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ChunkedArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray) __PYX_ERR(8, 507, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ChunkedArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ChunkedArray)) __PYX_ERR(8, 507, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Tabular",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular) __PYX_ERR(8, 522, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib__Tabular = (struct __pyx_vtabstruct_7pyarrow_3lib__Tabular*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib__Tabular)) __PYX_ERR(8, 522, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Table",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table) __PYX_ERR(8, 526, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Table = (struct __pyx_vtabstruct_7pyarrow_3lib_Table*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Table)) __PYX_ERR(8, 526, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RecordBatch",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch) __PYX_ERR(8, 536, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_RecordBatch = (struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_RecordBatch)) __PYX_ERR(8, 536, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Device",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device) __PYX_ERR(8, 545, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Device = (struct __pyx_vtabstruct_7pyarrow_3lib_Device*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Device)) __PYX_ERR(8, 545, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MemoryManager",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager) __PYX_ERR(8, 557, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MemoryManager = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MemoryManager)) __PYX_ERR(8, 557, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Buffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer) __PYX_ERR(8, 569, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Buffer = (struct __pyx_vtabstruct_7pyarrow_3lib_Buffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Buffer)) __PYX_ERR(8, 569, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ResizableBuffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer) __PYX_ERR(8, 579, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer = (struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer)) __PYX_ERR(8, 579, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NativeFile",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile) __PYX_ERR(8, 584, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NativeFile = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NativeFile)) __PYX_ERR(8, 584, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BufferedInputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream) __PYX_ERR(8, 608, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream)) __PYX_ERR(8, 608, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BufferedOutputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream) __PYX_ERR(8, 612, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream)) __PYX_ERR(8, 612, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CompressedInputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream) __PYX_ERR(8, 616, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream)) __PYX_ERR(8, 616, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CompressedOutputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream) __PYX_ERR(8, 620, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream)) __PYX_ERR(8, 620, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_CRecordBatchWriter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter) __PYX_ERR(8, 624, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatchReader = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RecordBatchReader",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatchReader) __PYX_ERR(8, 629, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CacheOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions) __PYX_ERR(8, 634, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CacheOptions = (struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CacheOptions)) __PYX_ERR(8, 634, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Codec",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec) __PYX_ERR(8, 646, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Codec = (struct __pyx_vtabstruct_7pyarrow_3lib_Codec*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Codec)) __PYX_ERR(8, 646, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StopToken",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken) __PYX_ERR(8, 654, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StopToken = (struct __pyx_vtabstruct_7pyarrow_3lib_StopToken*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StopToken)) __PYX_ERR(8, 654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow._fs"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileInfo = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "FileInfo",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileInfo),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileInfo),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileInfo),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileInfo) __PYX_ERR(9, 33, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_FileInfo = (struct __pyx_vtabstruct_7pyarrow_3_fs_FileInfo*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileInfo); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_FileInfo)) __PYX_ERR(9, 33, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSelector = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "FileSelector",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSelector), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSelector),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSelector), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSelector),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSelector), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSelector),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSelector) __PYX_ERR(9, 46, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_FileSelector = (struct __pyx_vtabstruct_7pyarrow_3_fs_FileSelector*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSelector); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_FileSelector)) __PYX_ERR(9, 46, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSystem = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "FileSystem",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSystem),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSystem),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_FileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_FileSystem),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSystem) __PYX_ERR(9, 56, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_FileSystem = (struct __pyx_vtabstruct_7pyarrow_3_fs_FileSystem*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_FileSystem); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_FileSystem)) __PYX_ERR(9, 56, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_LocalFileSystem = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "LocalFileSystem",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_LocalFileSystem),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_LocalFileSystem) __PYX_ERR(9, 69, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_LocalFileSystem = (struct __pyx_vtabstruct_7pyarrow_3_fs_LocalFileSystem*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_LocalFileSystem); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_LocalFileSystem)) __PYX_ERR(9, 69, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "SubTreeFileSystem",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_SubTreeFileSystem),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem) __PYX_ERR(9, 73, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_SubTreeFileSystem = (struct __pyx_vtabstruct_7pyarrow_3_fs_SubTreeFileSystem*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_SubTreeFileSystem); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_SubTreeFileSystem)) __PYX_ERR(9, 73, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs__MockFileSystem = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "_MockFileSystem",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs__MockFileSystem),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs__MockFileSystem) __PYX_ERR(9, 80, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs__MockFileSystem = (struct __pyx_vtabstruct_7pyarrow_3_fs__MockFileSystem*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs__MockFileSystem); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs__MockFileSystem)) __PYX_ERR(9, 80, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3_fs_PyFileSystem = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._fs", "PyFileSystem",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3_fs_PyFileSystem),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_PyFileSystem) __PYX_ERR(9, 87, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3_fs_PyFileSystem = (struct __pyx_vtabstruct_7pyarrow_3_fs_PyFileSystem*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3_fs_PyFileSystem); if (unlikely(!__pyx_vtabptr_7pyarrow_3_fs_PyFileSystem)) __PYX_ERR(9, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow._acero"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_6_acero_Declaration = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._acero", "Declaration",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_6_acero_Declaration), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_Declaration),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_6_acero_Declaration), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_Declaration),
  #else
  sizeof(struct __pyx_obj_7pyarrow_6_acero_Declaration), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_6_acero_Declaration),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_6_acero_Declaration) __PYX_ERR(10, 34, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_6_acero_Declaration = (struct __pyx_vtabstruct_7pyarrow_6_acero_Declaration*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_6_acero_Declaration); if (unlikely(!__pyx_vtabptr_7pyarrow_6_acero_Declaration)) __PYX_ERR(10, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow._compute"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_8_compute_UdfContext = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._compute", "UdfContext",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_8_compute_UdfContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_UdfContext),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_8_compute_UdfContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_UdfContext),
  #else
  sizeof(struct __pyx_obj_7pyarrow_8_compute_UdfContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_UdfContext),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_UdfContext) __PYX_ERR(11, 24, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_compute_UdfContext = (struct __pyx_vtabstruct_7pyarrow_8_compute_UdfContext*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_UdfContext); if (unlikely(!__pyx_vtabptr_7pyarrow_8_compute_UdfContext)) __PYX_ERR(11, 24, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_8_compute_FunctionOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._compute", "FunctionOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_FunctionOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_FunctionOptions) __PYX_ERR(11, 31, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_compute_FunctionOptions = (struct __pyx_vtabstruct_7pyarrow_8_compute_FunctionOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_FunctionOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_8_compute_FunctionOptions)) __PYX_ERR(11, 31, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_8_compute__SortOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._compute", "_SortOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_8_compute__SortOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute__SortOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_8_compute__SortOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute__SortOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_8_compute__SortOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute__SortOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_8_compute__SortOptions) __PYX_ERR(11, 41, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_compute__SortOptions = (struct __pyx_vtabstruct_7pyarrow_8_compute__SortOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_compute__SortOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_8_compute__SortOptions)) __PYX_ERR(11, 41, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_8_compute_Expression = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._compute", "Expression",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_8_compute_Expression), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_Expression),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_8_compute_Expression), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_Expression),
  #else
  sizeof(struct __pyx_obj_7pyarrow_8_compute_Expression), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_8_compute_Expression),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_Expression) __PYX_ERR(11, 48, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_8_compute_Expression = (struct __pyx_vtabstruct_7pyarrow_8_compute_Expression*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_8_compute_Expression); if (unlikely(!__pyx_vtabptr_7pyarrow_8_compute_Expression)) __PYX_ERR(11, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow._csv"); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ConvertOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._csv", "ConvertOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ConvertOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ConvertOptions) __PYX_ERR(12, 24, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_4_csv_ConvertOptions = (struct __pyx_vtabstruct_7pyarrow_4_csv_ConvertOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ConvertOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_4_csv_ConvertOptions)) __PYX_ERR(12, 24, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ParseOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._csv", "ParseOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ParseOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ParseOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ParseOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ParseOptions) __PYX_ERR(12, 32, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_4_csv_ParseOptions = (struct __pyx_vtabstruct_7pyarrow_4_csv_ParseOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ParseOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_4_csv_ParseOptions)) __PYX_ERR(12, 32, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ReadOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._csv", "ReadOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ReadOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ReadOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_4_csv_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_ReadOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ReadOptions) __PYX_ERR(12, 41, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_4_csv_ReadOptions = (struct __pyx_vtabstruct_7pyarrow_4_csv_ReadOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_ReadOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_4_csv_ReadOptions)) __PYX_ERR(12, 41, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_4_csv_WriteOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._csv", "WriteOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_4_csv_WriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_WriteOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_4_csv_WriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_WriteOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_4_csv_WriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_4_csv_WriteOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_WriteOptions) __PYX_ERR(12, 50, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_4_csv_WriteOptions = (struct __pyx_vtabstruct_7pyarrow_4_csv_WriteOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_4_csv_WriteOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_4_csv_WriteOptions)) __PYX_ERR(12, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow._json"); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_5_json_ParseOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._json", "ParseOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_5_json_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ParseOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_5_json_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ParseOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_5_json_ParseOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ParseOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_5_json_ParseOptions) __PYX_ERR(13, 24, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_5_json_ParseOptions = (struct __pyx_vtabstruct_7pyarrow_5_json_ParseOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_5_json_ParseOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_5_json_ParseOptions)) __PYX_ERR(13, 24, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_5_json_ReadOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow._json", "ReadOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_5_json_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ReadOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_5_json_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ReadOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_5_json_ReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_5_json_ReadOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_5_json_ReadOptions) __PYX_ERR(13, 31, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_5_json_ReadOptions = (struct __pyx_vtabstruct_7pyarrow_5_json_ReadOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_5_json_ReadOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_5_json_ReadOptions)) __PYX_ERR(13, 31, __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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  {
    __pyx_t_1 = PyImport_ImportModule("pyarrow._compute"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_arrow_compute_Expression__true);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 27;
    void **const __pyx_import_pointers[] = {(void **)&__pyx_vp_7pyarrow_8_compute__true, (void **) NULL};
    void **const *__pyx_import_pointer = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportVoidPtr_3_2_4(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __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_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  {
    __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_arrow_Field_MergeOptions_PyObje);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 811;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_7pyarrow_3lib__parse_field_merge_options, (void (**)(void))&__pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_array, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_table, (void (**)(void))&__pyx_f_7pyarrow_3lib_check_status, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table, (void (**)(void))&__pyx_f_7pyarrow_3lib_make_streamwrap_func, (void (**)(void))&__pyx_f_7pyarrow_3lib_get_native_file, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_4(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  {
    __pyx_t_1 = PyImport_ImportModule("pyarrow._compute"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_arrow_compute_Expression_struct);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 119;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_7pyarrow_8_compute__bind, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_4(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __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;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__dataset(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__dataset},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "_dataset",
      __pyx_k_Dataset_is_currently_unstable_AP, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit__dataset(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__dataset(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
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, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    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__dataset(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_dataset' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_dataset" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit__dataset", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_pyarrow___dataset) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pyarrow._dataset")) {
      if (unlikely((PyDict_SetItemString(modules, "pyarrow._dataset", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_variable_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "pyarrow/_dataset.pyx":24
 * from cython.operator cimport dereference as deref
 * 
 * import codecs             # <<<<<<<<<<<<<<
 * import collections
 * from libcpp cimport bool
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_codecs, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_codecs, __pyx_t_2) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":25
 * 
 * import codecs
 * import collections             # <<<<<<<<<<<<<<
 * from libcpp cimport bool
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":28
 * from libcpp cimport bool
 * 
 * import pyarrow as pa             # <<<<<<<<<<<<<<
 * from pyarrow.lib cimport *
 * from pyarrow.lib import ArrowTypeError, frombytes, tobytes, _pac
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pa, __pyx_t_2) < (0)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":30
 * import pyarrow as pa
 * from pyarrow.lib cimport *
 * from pyarrow.lib import ArrowTypeError, frombytes, tobytes, _pac             # <<<<<<<<<<<<<<
 * from pyarrow.includes.libarrow_dataset cimport *
 * from pyarrow._acero cimport ExecNodeOptions
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ArrowTypeError,__pyx_mstate_global->__pyx_n_u_frombytes,__pyx_mstate_global->__pyx_n_u_tobytes,__pyx_mstate_global->__pyx_n_u_pac};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_lib, __pyx_imported_names, 4, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ArrowTypeError,__pyx_mstate_global->__pyx_n_u_frombytes,__pyx_mstate_global->__pyx_n_u_tobytes,__pyx_mstate_global->__pyx_n_u_pac};
    for (__pyx_t_3=0; __pyx_t_3 < 4; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 30, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":34
 * from pyarrow._acero cimport ExecNodeOptions
 * from pyarrow._compute cimport Expression, _bind
 * from pyarrow._compute import _forbid_instantiation             # <<<<<<<<<<<<<<
 * from pyarrow._fs cimport FileSystem, FileSelector, FileInfo
 * from pyarrow._csv cimport (
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_forbid_instantiation};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow__compute, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_forbid_instantiation};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 34, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":38
 * from pyarrow._csv cimport (
 *     ConvertOptions, ParseOptions, ReadOptions, WriteOptions)
 * from pyarrow.util import _is_iterable, _is_path_like, _stringify_path             # <<<<<<<<<<<<<<
 * from pyarrow._json cimport ParseOptions as JsonParseOptions
 * from pyarrow._json cimport ReadOptions as JsonReadOptions
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_is_iterable,__pyx_mstate_global->__pyx_n_u_is_path_like,__pyx_mstate_global->__pyx_n_u_stringify_path};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_util, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_is_iterable,__pyx_mstate_global->__pyx_n_u_is_path_like,__pyx_mstate_global->__pyx_n_u_stringify_path};
    for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":42
 * from pyarrow._json cimport ReadOptions as JsonReadOptions
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pyarrow.substrait as pa_substrait
 * except ImportError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "pyarrow/_dataset.pyx":43
 * 
 * try:
 *     import pyarrow.substrait as pa_substrait             # <<<<<<<<<<<<<<
 * except ImportError:
 *     pa_substrait = None
*/
      __pyx_t_7 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_substrait, 0, 0, NULL, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L2_error)
      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_substrait);
      Py_DECREF(__pyx_t_7);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L2_error)
      __pyx_t_7 = __pyx_t_8;
      __pyx_t_2 = __pyx_t_7;
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pa_substrait, __pyx_t_2) < (0)) __PYX_ERR(0, 43, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/_dataset.pyx":42
 * from pyarrow._json cimport ReadOptions as JsonReadOptions
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pyarrow.substrait as pa_substrait
 * except ImportError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/_dataset.pyx":44
 * try:
 *     import pyarrow.substrait as pa_substrait
 * except ImportError:             # <<<<<<<<<<<<<<
 *     pa_substrait = None
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow._dataset", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_10) < 0) __PYX_ERR(0, 44, __pyx_L4_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_10);

      /* "pyarrow/_dataset.pyx":45
 *     import pyarrow.substrait as pa_substrait
 * except ImportError:
 *     pa_substrait = None             # <<<<<<<<<<<<<<
 * 
 * 
*/
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pa_substrait, Py_None) < (0)) __PYX_ERR(0, 45, __pyx_L4_except_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "pyarrow/_dataset.pyx":42
 * from pyarrow._json cimport ReadOptions as JsonReadOptions
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pyarrow.substrait as pa_substrait
 * except ImportError:
*/
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_5, __pyx_t_6);
    __pyx_L7_try_end:;
  }

  /* "pyarrow/_dataset.pyx":48
 * 
 * 
 * _DEFAULT_BATCH_SIZE = 2**17             # <<<<<<<<<<<<<<
 * _DEFAULT_BATCH_READAHEAD = 16
 * _DEFAULT_FRAGMENT_READAHEAD = 4
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE, __pyx_mstate_global->__pyx_int_131072) < (0)) __PYX_ERR(0, 48, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":49
 * 
 * _DEFAULT_BATCH_SIZE = 2**17
 * _DEFAULT_BATCH_READAHEAD = 16             # <<<<<<<<<<<<<<
 * _DEFAULT_FRAGMENT_READAHEAD = 4
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD, __pyx_mstate_global->__pyx_int_16) < (0)) __PYX_ERR(0, 49, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":50
 * _DEFAULT_BATCH_SIZE = 2**17
 * _DEFAULT_BATCH_READAHEAD = 16
 * _DEFAULT_FRAGMENT_READAHEAD = 4             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD, __pyx_mstate_global->__pyx_int_4) < (0)) __PYX_ERR(0, 50, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":54
 * 
 * # Initialise support for Datasets in ExecPlan
 * Initialize()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  arrow::dataset::internal::Initialize();

  /* "pyarrow/_dataset.pyx":57
 * 
 * 
 * _orc_fileformat = None             # <<<<<<<<<<<<<<
 * _orc_imported = False
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_fileformat, Py_None) < (0)) __PYX_ERR(0, 57, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":58
 * 
 * _orc_fileformat = None
 * _orc_imported = False             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_orc_imported, Py_False) < (0)) __PYX_ERR(0, 58, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":61
 * 
 * 
 * def _get_orc_fileformat():             # <<<<<<<<<<<<<<
 *     """
 *     Import OrcFileFormat on first usage (to avoid circular import issue
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_1_get_orc_fileformat, 0, __pyx_mstate_global->__pyx_n_u_get_orc_fileformat, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_orc_fileformat, __pyx_t_10) < (0)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":79
 * 
 * 
 * _dataset_pq = False             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_dataset_pq, Py_False) < (0)) __PYX_ERR(0, 79, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":82
 * 
 * 
 * def _get_parquet_classes():             # <<<<<<<<<<<<<<
 *     """
 *     Import Parquet class files on first usage (to avoid circular import issue
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_3_get_parquet_classes, 0, __pyx_mstate_global->__pyx_n_u_get_parquet_classes, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_parquet_classes, __pyx_t_10) < (0)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":95
 * 
 * 
 * def _get_parquet_symbol(name):             # <<<<<<<<<<<<<<
 *     """
 *     Get a symbol from pyarrow.parquet if the latter is importable, otherwise
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_5_get_parquet_symbol, 0, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_parquet_symbol, __pyx_t_10) < (0)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":159
 * 
 * 
 * cdef Expression _true = Expression._scalar(True)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_True};
    __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scalar, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_7pyarrow_8_compute_Expression))))) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_7pyarrow_8_dataset__true);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_8_dataset__true, ((struct __pyx_obj_7pyarrow_8_compute_Expression *)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":208
 *         return Expression.wrap(self.dataset.partition_expression())
 * 
 *     def replace_schema(self, Schema schema not None):             # <<<<<<<<<<<<<<
 *         """
 *         Return a copy of this Dataset with a different schema.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_3replace_schema, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_replace_schema, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_replace_schema, __pyx_t_10) < (0)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":231
 *         return d
 * 
 *     def get_fragments(self, Expression filter=None):             # <<<<<<<<<<<<<<
 *         """Returns an iterator over the fragments in this dataset.
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_5get_fragments, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_get_fragments, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[1]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_get_fragments_2, __pyx_t_10) < (0)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":256
 *         return self._get_fragments(filter)
 * 
 *     def _get_fragments(self, Expression filter):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CExpression c_filter
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_7_get_fragments, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset__get_fragments, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_get_fragments, __pyx_t_10) < (0)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":270
 *             yield Fragment.wrap(GetResultValue(move(maybe_fragment)))
 * 
 *     def _scanner_options(self, options):             # <<<<<<<<<<<<<<
 *         """Returns the default options to create a new Scanner.
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_10_scanner_options, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset__scanner_options, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_scanner_options, __pyx_t_10) < (0)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":298
 *                 object columns=None,
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__2 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":299
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__3 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":300
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__4 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":298
 *                 object columns=None,
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":299
 *                 object filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":300
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":295
 *         return new_options
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 object columns=None,
 *                 object filter=None,
*/
  __pyx_t_12 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_10, __pyx_t_4, __pyx_t_2, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_12scanner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_scanner, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_scanner, __pyx_t_2) < (0)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":431
 *                    object columns=None,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__5 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":432
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__6 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":433
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__7 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":431
 *                    object columns=None,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":432
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":433
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":428
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    object columns=None,
 *                    Expression filter=None,
*/
  __pyx_t_10 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_2, __pyx_t_12, __pyx_t_4, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_14to_batches, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_to_batches, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_to_batches, __pyx_t_4) < (0)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":511
 *                  object columns=None,
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__8 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":512
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__9 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":513
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__10 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":511
 *                  object columns=None,
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":512
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":513
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":508
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  object columns=None,
 *                  Expression filter=None,
*/
  __pyx_t_2 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_4, __pyx_t_10, __pyx_t_12, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_16to_table, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_to_table, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_to_table, __pyx_t_12) < (0)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pyarrow/_dataset.pyx":595
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__11 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":596
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__12 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":597
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__13 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":595
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":596
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":597
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":591
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/
  __pyx_t_4 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_12, __pyx_t_2, __pyx_t_10, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_18take, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_take, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_take, __pyx_t_10) < (0)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":678
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__14 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":679
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__15 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":680
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__16 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":678
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":679
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":680
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":674
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/
  __pyx_t_12 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_10, __pyx_t_4, __pyx_t_2, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_20head, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_head, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_head, __pyx_t_2) < (0)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":759
 *     def count_rows(self,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__17 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":760
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__18 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":761
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__19 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":759
 *     def count_rows(self,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":760
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":761
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":757
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
  __pyx_t_10 = PyTuple_Pack(8, Py_None, __pyx_t_2, __pyx_t_12, __pyx_t_4, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_22count_rows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_count_rows, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_count_rows, __pyx_t_4) < (0)) __PYX_ERR(0, 757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":821
 *         return pyarrow_wrap_schema(self.dataset.schema())
 * 
 *     def filter(self, expression not None):             # <<<<<<<<<<<<<<
 *         """
 *         Apply a row filter to the dataset.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_24filter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_filter, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_filter, __pyx_t_4) < (0)) __PYX_ERR(0, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":847
 *         return filtered_dataset
 * 
 *     def sort_by(self, sorting, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Sort the Dataset by one or multiple columns.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_26sort_by, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_sort_by, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_sort_by, __pyx_t_4) < (0)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_28join, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_join, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_join, __pyx_t_4) < (0)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":925
 *         )
 * 
 *     def join_asof(self, right_dataset, on, by, tolerance, right_on=None, right_by=None):             # <<<<<<<<<<<<<<
 *         """
 *         Perform an asof join between this dataset and another one.
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_30join_asof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset_join_asof, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Dataset, __pyx_mstate_global->__pyx_n_u_join_asof, __pyx_t_4) < (0)) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_32__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Dataset_34__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Dataset___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_15InMemoryDataset_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InMemoryDataset___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_15InMemoryDataset_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_InMemoryDataset___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1089
 *         self.union_dataset = <CUnionDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return UnionDataset, (self.schema, self.children)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12UnionDataset_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UnionDataset___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_UnionDataset, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_4) < (0)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1185
 *         self.filesystem_dataset = <CFileSystemDataset*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return FileSystemDataset, (
 *             list(self.get_fragments()),
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_17FileSystemDataset_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemDataset___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_4) < (0)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1194
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_17FileSystemDataset_5from_paths, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemDataset_from_paths, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_mstate_global->__pyx_n_u_from_paths, __pyx_t_4) < (0)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_mstate_global->__pyx_n_u_from_paths); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemDataset, __pyx_mstate_global->__pyx_n_u_from_paths, __pyx_t_10) < (0)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16FileWriteOptions_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileWriteOptions___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16FileWriteOptions_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileWriteOptions___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":1331
 *         return self.wrapped
 * 
 *     def inspect(self, file, filesystem=None):             # <<<<<<<<<<<<<<
 *         """
 *         Infer the schema of a file.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_10FileFormat_3inspect, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFormat_inspect, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[1]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, __pyx_mstate_global->__pyx_n_u_inspect, __pyx_t_10) < (0)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1358
 *     def make_fragment(self, file, filesystem=None,
 *                       Expression partition_expression=None,
 *                       *, file_size=None):             # <<<<<<<<<<<<<<
 *         """
 *         Make a FileFragment from a given file.
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_file_size, Py_None) < (0)) __PYX_ERR(0, 1356, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":1356
 *         return pyarrow_wrap_schema(move(c_schema))
 * 
 *     def make_fragment(self, file, filesystem=None,             # <<<<<<<<<<<<<<
 *                       Expression partition_expression=None,
 *                       *, file_size=None):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_10FileFormat_5make_fragment, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFormat_make_fragment, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, __pyx_mstate_global->__pyx_n_u_make_fragment, __pyx_t_4) < (0)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1390
 *         return Fragment.wrap(move(c_fragment))
 * 
 *     def make_write_options(self):             # <<<<<<<<<<<<<<
 *         sp_write_options = self.format.DefaultWriteOptions()
 *         if sp_write_options.get() == nullptr:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_10FileFormat_7make_write_options, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFormat_make_write_options, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFormat, __pyx_mstate_global->__pyx_n_u_make_write_options, __pyx_t_4) < (0)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_10FileFormat_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFormat___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.format,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_10FileFormat_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFormat___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1490
 *                 object columns=None,
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__21 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1491
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__22 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1492
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__23 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1490
 *                 object columns=None,
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1491
 *                 Expression filter=None,
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                 FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1492
 *                 int batch_size=_DEFAULT_BATCH_SIZE,
 *                 int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                 int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                 FragmentScanOptions fragment_scan_options=None,
 *                 bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":1486
 *         return Expression.wrap(self.fragment.partition_expression())
 * 
 *     def scanner(self,             # <<<<<<<<<<<<<<
 *                 Schema schema=None,
 *                 object columns=None,
*/
  __pyx_t_2 = PyTuple_Pack(10, Py_None, Py_None, Py_None, __pyx_t_4, __pyx_t_10, __pyx_t_12, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_3scanner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_scanner, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_scanner, __pyx_t_12) < (0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pyarrow/_dataset.pyx":1581
 *                    object columns=None,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__24 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1582
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__25 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1583
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__26 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1581
 *                    object columns=None,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":1582
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1583
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1577
 *         )
 * 
 *     def to_batches(self,             # <<<<<<<<<<<<<<
 *                    Schema schema=None,
 *                    object columns=None,
*/
  __pyx_t_4 = PyTuple_Pack(10, Py_None, Py_None, Py_None, __pyx_t_12, __pyx_t_2, __pyx_t_10, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_5to_batches, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_to_batches, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_to_batches, __pyx_t_10) < (0)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":1666
 *                  object columns=None,
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__27 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1667
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__28 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1668
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__29 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1666
 *                  object columns=None,
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1667
 *                  Expression filter=None,
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                  FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1668
 *                  int batch_size=_DEFAULT_BATCH_SIZE,
 *                  int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                  int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                  FragmentScanOptions fragment_scan_options=None,
 *                  bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1662
 *         ).to_batches()
 * 
 *     def to_table(self,             # <<<<<<<<<<<<<<
 *                  Schema schema=None,
 *                  object columns=None,
*/
  __pyx_t_12 = PyTuple_Pack(10, Py_None, Py_None, Py_None, __pyx_t_10, __pyx_t_4, __pyx_t_2, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_7to_table, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_to_table, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_to_table, __pyx_t_2) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":1753
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__30 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1754
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__31 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1755
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__32 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1753
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1754
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":1755
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1749
 *         ).to_table()
 * 
 *     def take(self,             # <<<<<<<<<<<<<<
 *              object indices,
 *              object columns=None,
*/
  __pyx_t_10 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_2, __pyx_t_12, __pyx_t_4, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_9take, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_take, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_take, __pyx_t_4) < (0)) __PYX_ERR(0, 1749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":1836
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__33 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1837
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__34 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1838
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__35 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1836
 *              object columns=None,
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":1837
 *              Expression filter=None,
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *              FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1838
 *              int batch_size=_DEFAULT_BATCH_SIZE,
 *              int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *              int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *              FragmentScanOptions fragment_scan_options=None,
 *              bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":1832
 *         ).take(indices)
 * 
 *     def head(self,             # <<<<<<<<<<<<<<
 *              int num_rows,
 *              object columns=None,
*/
  __pyx_t_2 = PyTuple_Pack(9, Py_None, Py_None, __pyx_t_4, __pyx_t_10, __pyx_t_12, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_11head, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_head, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_head, __pyx_t_12) < (0)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "pyarrow/_dataset.pyx":1917
 *     def count_rows(self,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__36 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1918
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__37 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1919
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_mstate_global->__pyx_k__38 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":1917
 *     def count_rows(self,
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_12); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);

  /* "pyarrow/_dataset.pyx":1918
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                    FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":1919
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
 *                    int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                    int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                    FragmentScanOptions fragment_scan_options=None,
 *                    bint use_threads=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":1915
 *         ).head(num_rows)
 * 
 *     def count_rows(self,             # <<<<<<<<<<<<<<
 *                    Expression filter=None,
 *                    int batch_size=_DEFAULT_BATCH_SIZE,
*/
  __pyx_t_4 = PyTuple_Pack(8, Py_None, __pyx_t_12, __pyx_t_2, __pyx_t_10, Py_None, Py_True, Py_True, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_13count_rows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment_count_rows, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Fragment, __pyx_mstate_global->__pyx_n_u_count_rows, __pyx_t_10) < (0)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.fragment,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_8Fragment_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fragment___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":1997
 *         return f"<pyarrow.dataset.{self.__class__.__name__}{typ} path={self.path}{partition}>"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         buffer = self.buffer
 *         return self.format.make_fragment, (
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12FileFragment_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFragment___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 1997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2005
 *         )
 * 
 *     def open(self):             # <<<<<<<<<<<<<<
 *         """
 *         Open a NativeFile of the buffer or file viewed by this fragment.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12FileFragment_5open, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileFragment_open, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileFragment, __pyx_mstate_global->__pyx_n_u_open, __pyx_t_10) < (0)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19FragmentScanOptions_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FragmentScanOptions___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19FragmentScanOptions_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FragmentScanOptions___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19IpcFileWriteOptions_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IpcFileWriteOptions___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19IpcFileWriteOptions_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IpcFileWriteOptions___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2147
 *         self.init(shared_ptr[CFileFormat](new CIpcFileFormat()))
 * 
 *     def equals(self, IpcFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_3equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IpcFileFormat_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_10) < (0)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2159
 *         return True
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_5make_write_options, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IpcFileFormat_make_write_options, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat, __pyx_mstate_global->__pyx_n_u_make_write_options, __pyx_t_10) < (0)) __PYX_ERR(0, 2159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2178
 *         return "arrow"
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return IpcFileFormat, tuple()
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13IpcFileFormat_7__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IpcFileFormat___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_IpcFileFormat, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2212
 * 
 *     # Avoid mistakingly creating attributes
 *     __slots__ = ()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, ParseOptions parse_options=None,
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_empty_tuple) < (0)) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2244
 *         self.csv_format = <CCsvFileFormat*> sp.get()
 * 
 *     def make_write_options(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_3make_write_options, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFileFormat_make_write_options, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, __pyx_mstate_global->__pyx_n_u_make_write_options, __pyx_t_10) < (0)) __PYX_ERR(0, 2244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2275
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, CsvFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_5equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFileFormat_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_10) < (0)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2290
 *             other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFileFormat, (self.parse_options,
 *                                self.default_fragment_scan_options)
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13CsvFileFormat_7__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFileFormat___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFileFormat, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2317
 * 
 *     # Avoid mistakingly creating attributes
 *     __slots__ = ()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, ConvertOptions convert_options=None,
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_empty_tuple) < (0)) __PYX_ERR(0, 2317, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2356
 *                 make_streamwrap_func(read_options.encoding, 'utf-8'))
 * 
 *     def equals(self, CsvFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_22CsvFragmentScanOptions_3equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFragmentScanOptions_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_10) < (0)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2371
 *             self.read_options.equals(other.read_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return CsvFragmentScanOptions, (self.convert_options,
 *                                         self.read_options)
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_22CsvFragmentScanOptions_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFragmentScanOptions___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_CsvFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19CsvFileWriteOptions_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFileWriteOptions___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19CsvFileWriteOptions_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CsvFileWriteOptions___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2415
 * 
 *     # Avoid mistakingly creating attributes
 *     __slots__ = ()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, default_fragment_scan_options=None,
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_empty_tuple) < (0)) __PYX_ERR(0, 2415, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2450
 *             super()._set_default_fragment_scan_options(options)
 * 
 *     def equals(self, JsonFileFormat other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14JsonFileFormat_3equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_JsonFileFormat_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_10) < (0)) __PYX_ERR(0, 2450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2464
 *                 other.default_fragment_scan_options)
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFileFormat, (self.default_fragment_scan_options,)
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14JsonFileFormat_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_JsonFileFormat___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFileFormat, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2486
 * 
 *      # Avoid mistakingly creating attributes
 *     __slots__ = ()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, JsonParseOptions parse_options=None,
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_empty_tuple) < (0)) __PYX_ERR(0, 2486, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":2517
 *         self.json_options.read_options = read_options.options
 * 
 *     def equals(self, JsonFragmentScanOptions other):             # <<<<<<<<<<<<<<
 *         """
 *         Parameters
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_23JsonFragmentScanOptions_3equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_JsonFragmentScanOptions_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_10) < (0)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2532
 *             self.parse_options.equals(other.parse_options))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return JsonFragmentScanOptions, (self.parse_options, self.read_options)
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_23JsonFragmentScanOptions_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_JsonFragmentScanOptions___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_JsonFragmentScanOptions, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2571
 *         return False
 * 
 *     def parse(self, path):             # <<<<<<<<<<<<<<
 *         """
 *         Parse a path into a partition expression.
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12Partitioning_5parse, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioning_parse, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning, __pyx_mstate_global->__pyx_n_u_parse, __pyx_t_10) < (0)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2587
 *         return Expression.wrap(GetResultValue(result))
 * 
 *     def format(self, expr):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a filter expression into a tuple of (directory, filename) using
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12Partitioning_7format, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioning_format, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Partitioning, __pyx_mstate_global->__pyx_n_u_format, __pyx_t_10) < (0)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12Partitioning_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioning___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.partitioning,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_12Partitioning_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioning___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_10) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2653
 *         return self.wrapped
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return self.constructor, self.options
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19PartitioningFactory_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PartitioningFactory___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_PartitioningFactory, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2694
 *         self.partitioning = sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_20KeyValuePartitioning_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KeyValuePartitioning___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_KeyValuePartitioning, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2726
 * 
 * 
 * def _constructor_directory_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return DirectoryPartitioning.discover(*args)
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7_constructor_directory_partitioning_factory, 0, __pyx_mstate_global->__pyx_n_u_constructor_directory_partition, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_constructor_directory_partition, __pyx_t_10) < (0)) __PYX_ERR(0, 2726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2786
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_21DirectoryPartitioning_3discover, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DirectoryPartitioning_discover, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 2786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning, __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DirectoryPartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 2786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2854
 * 
 * 
 * def _constructor_hive_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return HivePartitioning.discover(*args)
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_9_constructor_hive_partitioning_factory, 0, __pyx_mstate_global->__pyx_n_u_constructor_hive_partitioning_f, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_constructor_hive_partitioning_f, __pyx_t_10) < (0)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2928
 *         self.hive_partitioning = <CHivePartitioning*> sp.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         dictionaries = self.dictionaries
 *         if dictionaries:
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16HivePartitioning_3__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HivePartitioning___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_10) < (0)) __PYX_ERR(0, 2928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":2940
 *         )
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16HivePartitioning_5discover, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_HivePartitioning_discover, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning, __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_HivePartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3005
 * 
 * 
 * def _constructor_filename_partitioning_factory(*args):             # <<<<<<<<<<<<<<
 *     return FilenamePartitioning.discover(*args)
 * 
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_11_constructor_filename_partitioning_factory, 0, __pyx_mstate_global->__pyx_n_u_constructor_filename_partitioni, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_constructor_filename_partitioni, __pyx_t_10) < (0)) __PYX_ERR(0, 3005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3065
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_20FilenamePartitioning_3discover, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FilenamePartitioning_discover, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 3065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning, __pyx_mstate_global->__pyx_n_u_discover); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FilenamePartitioning, __pyx_mstate_global->__pyx_n_u_discover, __pyx_t_10) < (0)) __PYX_ERR(0, 3065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3152
 *         check_status(self.factory.SetRootPartition(expr.unwrap()))
 * 
 *     def inspect_schemas(self):             # <<<<<<<<<<<<<<
 *         cdef CResult[vector[shared_ptr[CSchema]]] result
 *         cdef CInspectOptions options
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_3inspect_schemas, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DatasetFactory_inspect_schemas, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory, __pyx_mstate_global->__pyx_n_u_inspect_schemas, __pyx_t_10) < (0)) __PYX_ERR(0, 3152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3163
 *         return schemas
 * 
 *     def inspect(self, *, promote_options="default", fragments=None):             # <<<<<<<<<<<<<<
 *         """
 *         Inspect data fragments and return a common Schema.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_promote_options, __pyx_mstate_global->__pyx_n_u_default) < (0)) __PYX_ERR(0, 3163, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fragments, Py_None) < (0)) __PYX_ERR(0, 3163, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_5inspect, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DatasetFactory_inspect, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory, __pyx_mstate_global->__pyx_n_u_inspect, __pyx_t_2) < (0)) __PYX_ERR(0, 3163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3199
 *         return pyarrow_wrap_schema(GetResultValue(result))
 * 
 *     def finish(self, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Dataset using the inspected schema or an explicit schema
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_7finish, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DatasetFactory_finish, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_DatasetFactory, __pyx_mstate_global->__pyx_n_u_finish, __pyx_t_2) < (0)) __PYX_ERR(0, 3199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DatasetFactory___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_14DatasetFactory_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DatasetFactory___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3259
 *         CFileSystemFactoryOptions options
 * 
 *     __slots__ = ()  # avoid mistakingly creating attributes             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, partition_base_dir=None, partitioning=None,
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_FileSystemFactoryOptions, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_empty_tuple) < (0)) __PYX_ERR(0, 3259, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_24FileSystemFactoryOptions_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemFactoryOptions___reduc, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_24FileSystemFactoryOptions_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemFactoryOptions___setst, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_24FileSystemDatasetFactory_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemDatasetFactory___reduc, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_24FileSystemDatasetFactory_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FileSystemDatasetFactory___setst, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19UnionDatasetFactory_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UnionDatasetFactory___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.factory,self.union_factory,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19UnionDatasetFactory_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_UnionDatasetFactory___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19RecordBatchIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_RecordBatchIterator___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_19RecordBatchIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_RecordBatchIterator___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3486
 * 
 * 
 * class TaggedRecordBatch(collections.namedtuple(             # <<<<<<<<<<<<<<
 *         "TaggedRecordBatch", ["record_batch", "fragment"])):
 *     """
*/
  __pyx_t_10 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_namedtuple); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":3487
 * 
 * class TaggedRecordBatch(collections.namedtuple(
 *         "TaggedRecordBatch", ["record_batch", "fragment"])):             # <<<<<<<<<<<<<<
 *     """
 *     A combination of a record batch and the fragment it came from.
*/
  __pyx_t_4 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_record_batch, __pyx_mstate_global->__pyx_n_u_fragment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "pyarrow/_dataset.pyx":3486
 * 
 * 
 * class TaggedRecordBatch(collections.namedtuple(             # <<<<<<<<<<<<<<
 *         "TaggedRecordBatch", ["record_batch", "fragment"])):
 *     """
*/
  __pyx_t_12 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_kp_u_A_combination_of_a_record_batch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_2 != __pyx_t_12) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_12) < 0))) __PYX_ERR(0, 3486, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_12);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatch, __pyx_t_12) < (0)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_25TaggedRecordBatchIterator_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatchIterator___redu, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.iterator cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_25TaggedRecordBatchIterator_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TaggedRecordBatchIterator___sets, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3534
 * cdef void _populate_builder(const shared_ptr[CScannerBuilder]& ptr,
 *                             object columns=None, Expression filter=None,
 *                             int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                             int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                             int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__44 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3535
 *                             object columns=None, Expression filter=None,
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
 *                             int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                             int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                             bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__45 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3536
 *                             int batch_size=_DEFAULT_BATCH_SIZE,
 *                             int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                             int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                             bint use_threads=True, bint cache_metadata=True,
 *                             MemoryPool memory_pool=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__46 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3637
 *                      object columns=None,
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__47 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3638
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__48 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3639
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__49 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3633
 *         return GetResultValue(deref(builder).GetScanOptions())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_dataset.pyx":3635
 *     @staticmethod
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,             # <<<<<<<<<<<<<<
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_columns, Py_None) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3636
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
 *                      object filter=None,             # <<<<<<<<<<<<<<
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_filter, Py_None) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3637
 *                      object columns=None,
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_4) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":3638
 *                      object filter=None,
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_4) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":3639
 *                      int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_4) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":3640
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_fragment_scan_options, Py_None) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3641
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                      MemoryPool memory_pool=None):
 *         """
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_use_threads, Py_True) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_cache_metadata, Py_True) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3642
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Dataset,
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_memory_pool, Py_None) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3633
 *         return GetResultValue(deref(builder).GetScanOptions())
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dataset(Dataset dataset not None, *,
 *                      object columns=None,
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_3from_dataset, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_from_dataset, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_dataset, __pyx_t_4) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = NULL;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_dataset); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_dataset, __pyx_t_4) < (0)) __PYX_ERR(0, 3633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.pyx":3719
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__50 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3720
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__51 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3721
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_mstate_global->__pyx_k__52 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3716
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "pyarrow/_dataset.pyx":3717
 * 
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,             # <<<<<<<<<<<<<<
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_schema, Py_None) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3718
 *     @staticmethod
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,             # <<<<<<<<<<<<<<
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_columns, Py_None) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_filter, Py_None) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3719
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_10) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3720
 *                       object columns=None, Expression filter=None,
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_10) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3721
 *                       int batch_size=_DEFAULT_BATCH_SIZE,
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_10) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3722
 *                       int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fragment_scan_options, Py_None) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3723
 *                       int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                       MemoryPool memory_pool=None):
 *         """
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_use_threads, Py_True) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cache_metadata, Py_True) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3724
 *                       FragmentScanOptions fragment_scan_options=None,
 *                       bint use_threads=True, bint cache_metadata=True,
 *                       MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create Scanner from Fragment,
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_memory_pool, Py_None) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3716
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_fragment(Fragment fragment not None, *, Schema schema=None,
 *                       object columns=None, Expression filter=None,
*/
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_5from_fragment, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_from_fragment, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_fragment, __pyx_t_10) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_4 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_fragment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_fragment, __pyx_t_10) < (0)) __PYX_ERR(0, 3716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_dataset.pyx":3804
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__53 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3805
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__54 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3806
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_10); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_mstate_global->__pyx_k__55 = __pyx_t_9;

  /* "pyarrow/_dataset.pyx":3802
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "pyarrow/_dataset.pyx":3803
 * 
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,             # <<<<<<<<<<<<<<
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_schema, Py_None) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_columns, Py_None) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3804
 *     @staticmethod
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,             # <<<<<<<<<<<<<<
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_filter, Py_None) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_batch_size, __pyx_t_2) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3805
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,             # <<<<<<<<<<<<<<
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_BATCH_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_batch_readahead, __pyx_t_2) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3806
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,             # <<<<<<<<<<<<<<
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DEFAULT_FRAGMENT_READAHEAD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fragment_readahead, __pyx_t_2) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3807
 *                      int batch_readahead=_DEFAULT_BATCH_READAHEAD,
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,             # <<<<<<<<<<<<<<
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fragment_scan_options, Py_None) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3808
 *                      int fragment_readahead=_DEFAULT_FRAGMENT_READAHEAD,
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,             # <<<<<<<<<<<<<<
 *                      MemoryPool memory_pool=None):
 *         """
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_use_threads, Py_True) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_cache_metadata, Py_True) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3809
 *                      FragmentScanOptions fragment_scan_options=None,
 *                      bint use_threads=True, bint cache_metadata=True,
 *                      MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Create a Scanner from an iterator of batches.
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_memory_pool, Py_None) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)

  /* "pyarrow/_dataset.pyx":3802
 *         return Scanner.wrap(scanner)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(source, *, Schema schema=None, object columns=None,
 *                      Expression filter=None, int batch_size=_DEFAULT_BATCH_SIZE,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_7from_batches, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_from_batches, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_batches, __pyx_t_2) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = NULL;
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_batches); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_from_batches, __pyx_t_2) < (0)) __PYX_ERR(0, 3802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3925
 *             self.scanner.options().get().projected_schema)
 * 
 *     def to_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_9to_batches, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_to_batches, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_to_batches, __pyx_t_2) < (0)) __PYX_ERR(0, 3925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3939
 *         return _iterator(self.scan_batches())
 * 
 *     def scan_batches(self):             # <<<<<<<<<<<<<<
 *         """
 *         Consume a Scanner in record batches with corresponding fragments.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_11scan_batches, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_scan_batches, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_scan_batches, __pyx_t_2) < (0)) __PYX_ERR(0, 3939, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3953
 *         return TaggedRecordBatchIterator.wrap(self, move(iterator))
 * 
 *     def to_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert a Scanner into a Table.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_13to_table, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_to_table, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_to_table, __pyx_t_2) < (0)) __PYX_ERR(0, 3953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3971
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def take(self, object indices):             # <<<<<<<<<<<<<<
 *         """
 *         Select rows of data by index.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_15take, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_take, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_take, __pyx_t_2) < (0)) __PYX_ERR(0, 3971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":3999
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def head(self, int num_rows):             # <<<<<<<<<<<<<<
 *         """
 *         Load the first N rows of the dataset.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_17head, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_head, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_head, __pyx_t_2) < (0)) __PYX_ERR(0, 3999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4017
 *         return pyarrow_wrap_table(GetResultValue(result))
 * 
 *     def count_rows(self):             # <<<<<<<<<<<<<<
 *         """
 *         Count rows matching the scanner filter.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_19count_rows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_count_rows, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_count_rows, __pyx_t_2) < (0)) __PYX_ERR(0, 4017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4030
 *         return GetResultValue(result)
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Consume this scanner as a RecordBatchReader.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_21to_reader, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner_to_reader, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_Scanner, __pyx_mstate_global->__pyx_n_u_to_reader, __pyx_t_2) < (0)) __PYX_ERR(0, 4030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_23__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.scanner,self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_7Scanner_25__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scanner___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4043
 * 
 * 
 * def get_partition_keys(Expression partition_expression):             # <<<<<<<<<<<<<<
 *     """
 *     Extract partition keys (equality constraints between a field and a scalar)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_13get_partition_keys, 0, __pyx_mstate_global->__pyx_n_u_get_partition_keys, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_partition_keys, __pyx_t_2) < (0)) __PYX_ERR(0, 4043, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_11WrittenFile_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WrittenFile___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_WrittenFile, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_WrittenFile, (type(self), 0x2aeeab1, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_WrittenFile__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_11WrittenFile_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_WrittenFile___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset_WrittenFile, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4117
 * 
 * 
 * def _filesystemdataset_write(             # <<<<<<<<<<<<<<
 *     Scanner data not None,
 *     object base_dir not None,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_15_filesystemdataset_write, 0, __pyx_mstate_global->__pyx_n_u_filesystemdataset_write, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_filesystemdataset_write, __pyx_t_2) < (0)) __PYX_ERR(0, 4117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4182
 * cdef class _ScanNodeOptions(ExecNodeOptions):
 * 
 *     def _set_options(self, Dataset dataset, dict scan_options):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CScanOptions] c_scan_options
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_1_set_options, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions__set_options, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions, __pyx_mstate_global->__pyx_n_u_set_options, __pyx_t_2) < (0)) __PYX_ERR(0, 4182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.wrapped cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_16_ScanNodeOptions_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4198
 * 
 * 
 * class ScanNodeOptions(_ScanNodeOptions):             # <<<<<<<<<<<<<<
 *     """
 *     A Source node which yields batches from a Dataset scan.
*/
  __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_8_dataset__ScanNodeOptions)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions_2, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions_2, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_kp_u_A_Source_node_which_yields_batc); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  if (__pyx_t_4 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 4198, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4227
 *     """
 * 
 *     def __init__(self, Dataset dataset, **kwargs):             # <<<<<<<<<<<<<<
 *         self._set_options(dataset, kwargs)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_15ScanNodeOptions_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions___init, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < (0)) __PYX_ERR(0, 4227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_dataset.pyx":4198
 * 
 * 
 * class ScanNodeOptions(_ScanNodeOptions):             # <<<<<<<<<<<<<<
 *     """
 *     A Source node which yields batches from a Dataset scan.
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions_2, __pyx_t_4, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ScanNodeOptions_2, __pyx_t_2) < (0)) __PYX_ERR(0, 4198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_WrittenFile(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x2aeeab1, 0xb9a0db3, 0x14f8208, b'metadata, path, size')
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_8_dataset_17__pyx_unpickle_WrittenFile, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_WrittenFile, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__dataset, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_WrittenFile, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_dataset.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_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Dataset_scanner_line_295, __pyx_mstate_global->__pyx_kp_u_Build_a_scan_operation_against) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Partitioning_format_line_2587, __pyx_mstate_global->__pyx_kp_u_Convert_a_filter_expression_int) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init pyarrow._dataset", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyarrow._dataset");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2786, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1241, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 2273, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 2697, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyarrow/_dataset.pyx":4162
 *     else:
 *         raise ValueError(
 *             ("existing_data_behavior must be one of 'error', ",             # <<<<<<<<<<<<<<
 *              "'overwrite_or_ignore' or 'delete_matching'")
 *         )
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_existing_data_behavior_must_be_o, __pyx_mstate_global->__pyx_kp_u_overwrite_or_ignore_or_delete_m); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 4162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "pyarrow/_dataset.pyx":231
 *         return d
 * 
 *     def get_fragments(self, Expression filter=None):             # <<<<<<<<<<<<<<
 *         """Returns an iterator over the fragments in this dataset.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "pyarrow/_dataset.pyx":875
 *         return res
 * 
 *     def join(self, right_dataset, keys, right_keys=None, join_type="left outer",             # <<<<<<<<<<<<<<
 *              left_suffix=None, right_suffix=None, coalesce_keys=True,
 *              use_threads=True):
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(6, Py_None, __pyx_mstate_global->__pyx_kp_u_left_outer, Py_None, Py_None, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "pyarrow/_dataset.pyx":925
 *         )
 * 
 *     def join_asof(self, right_dataset, on, by, tolerance, right_on=None, right_by=None):             # <<<<<<<<<<<<<<
 *         """
 *         Perform an asof join between this dataset and another one.
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "pyarrow/_dataset.pyx":1194
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_paths(cls, paths, schema=None, format=None,
 *                    filesystem=None, partitions=None, root_partition=None):
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(5, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "pyarrow/_dataset.pyx":2786
 *         self.directory_partitioning = <CDirectoryPartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(5, Py_None, Py_False, __pyx_mstate_global->__pyx_int_0, Py_None, __pyx_mstate_global->__pyx_n_u_uri); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 2786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "pyarrow/_dataset.pyx":2940
 *         )
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(infer_dictionary=False,
 *                  max_partition_dictionary_size=0,
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(5, Py_False, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_n_u_HIVE_DEFAULT_PARTITION, Py_None, __pyx_mstate_global->__pyx_n_u_uri); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "pyarrow/_dataset.pyx":3065
 *         self.filename_partitioning = <CFilenamePartitioning*> sp.get()
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def discover(field_names=None, infer_dictionary=False,
 *                  schema=None, segment_encoding="uri"):
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(4, Py_None, Py_False, Py_None, __pyx_mstate_global->__pyx_n_u_uri); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 3065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<8; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 13; } index[] = {{1},{1149},{222},{10},{71},{4715},{38},{58},{90},{753},{29},{26},{82},{106},{64},{45},{60},{55},{91},{72},{16},{16},{53},{69},{57},{67},{4},{179},{64},{31},{93},{95},{26},{24},{58},{1},{0},{2},{1},{1},{1},{1},{8},{62},{35},{100},{101},{7},{6},{47},{2},{6},{31},{9},{8},{9},{9},{10},{52},{5},{42},{12},{6},{20},{17},{96},{96},{79},{100},{77},{101},{96},{77},{76},{78},{65},{64},{82},{77},{64},{15},{6},{5},{38},{5},{14},{16},{12},{13},{24},{20},{32},{19},{37},{39},{22},{33},{29},{24},{19},{27},{7},{14},{32},{34},{21},{22},{30},{25},{27},{22},{24},{18},{14},{21},{12},{12},{17},{22},{15},{15},{12},{18},{16},{14},{21},{30},{17},{10},{28},{30},{18},{24},{29},{12},{23},{17},{17},{24},{42},{44},{28},{28},{24},{42},{44},{16},{34},{36},{20},{29},{8},{19},{37},{39},{26},{28},{19},{13},{16},{13},{19},{17},{26},{16},{27},{25},{15},{33},{35},{13},{24},{20},{32},{19},{37},{39},{14},{25},{21},{23},{34},{30},{20},{31},{13},{17},{19},{23},{26},{12},{19},{30},{30},{32},{19},{18},{20},{11},{19},{37},{39},{17},{16},{15},{24},{34},{36},{29},{7},{25},{27},{18},{20},{20},{21},{12},{20},{12},{18},{17},{16},{5},{17},{25},{43},{45},{12},{19},{37},{39},{23},{11},{29},{31},{3},{4},{5},{5},{18},{5},{9},{18},{8},{17},{5},{10},{15},{10},{6},{7},{2},{13},{12},{8},{10},{11},{9},{9},{6},{8},{14},{9},{8},{8},{14},{8},{9},{6},{17},{18},{5},{3},{13},{6},{11},{7},{43},{42},{38},{15},{4},{10},{10},{3},{14},{1},{4},{7},{16},{11},{7},{29},{15},{8},{5},{12},{9},{8},{7},{1},{9},{6},{5},{21},{22},{4},{10},{11},{1},{9},{7},{11},{4},{12},{9},{12},{8},{10},{24},{6},{16},{6},{21},{6},{8},{18},{21},{9},{12},{12},{13},{10},{11},{9},{8},{3},{14},{13},{19},{20},{19},{18},{12},{4},{4},{1},{17},{7},{16},{8},{7},{15},{3},{13},{12},{13},{5},{9},{8},{4},{9},{9},{4},{4},{6},{11},{6},{8},{13},{18},{14},{29},{14},{17},{18},{14},{11},{13},{8},{18},{10},{15},{4},{8},{10},{5},{7},{10},{11},{4},{4},{13},{8},{2},{4},{6},{7},{4},{3},{15},{13},{5},{3},{11},{19},{2},{12},{4},{7},{5},{13},{18},{20},{12},{20},{10},{4},{5},{17},{13},{18},{15},{3},{11},{14},{15},{7},{16},{16},{20},{24},{11},{17},{12},{12},{14},{12},{11},{10},{26},{14},{12},{4},{12},{16},{6},{12},{10},{17},{13},{7},{14},{16},{24},{3},{6},{8},{13},{10},{8},{12},{14},{1},{7},{12},{13},{12},{7},{16},{6},{7},{16},{24},{4},{4},{34},{12},{12},{10},{12},{19},{4},{9},{7},{9},{12},{7},{6},{9},{16},{5},{12},{15},{18},{9},{5},{4},{8},{5},{10},{29},{9},{8},{7},{9},{4},{9},{5},{6},{3},{12},{11},{3},{5},{6},{10},{13},{3},{1114},{32},{124},{138},{14},{70},{115},{254},{81},{30},{14},{2},{139},{141},{83},{39},{217},{182},{140},{50},{72},{93},{12},{17},{129},{239},{97},{13},{83},{91},{41},{54},{17},{27},{32},{55},{34},{40},{156},{24},{34},{15},{11},{36},{164},{9},{38},{36},{47},{36},{68},{42},{41},{17},{88},{69},{99},{91},{13},{91},{89},{22},{102},{71},{9},{92},{115},{2},{11},{49},{107},{55},{62},{55},{24},{14}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (8272 bytes) */
const char* const cstring = "(\265/\375`\307Y5\002\001\352\336\200.H\340\3568\0070\314q>\302@\030Cc|\204\2010\020\006\302@\030\010\303)\260X1S\211\224\214-\322\364\305Z'\211\245\372|\260`2v3\t\264n\227\305\237\355>\303Z3\267\370o\3557\177\372v\025,H\006\322P~\002\253\002\374\002././%\252+\265\357\333R+T\034\315\005\373\326555\327\207\313\360\355\364\326:=\035@\373 \030j\317\376\207\236\233\214ka\215\343\217\333\332\3452\354\325\374_\324?g\326\375\302\256\3032\017\026\006\367\260z\330\251\333\373z\030\253?\273<\254\035^\217\273,\264uQ\247\315p\355\356\217\325\302<\201v\353\306\272wy\353\332\327\212\364'\333O\2449\376^-\254a\243[{\211q\261\255\010-W}\025\230\327\370s\\\344\241r\274\303\275W\226'\273\337\315\031w\254?O\266S\253Y\327\274\303\376\333uk?\225\247\366\313l2\374]\276\317\261\367\037\276D\327f\303e|i5O\005\266\201\036\326D7k\220\363\352=\347\027\357\216\177\345\367c\2552VU\024Fo-\nY}\036\362K\344\335\372[\327>\374.Qm\341\262\266\350\363\n\333\276\254\225\007\366\033z^\370\345\312\351\2365\017\307_\256\205_\306\236v\321\\+\336U\326\345f\034\337!\327,\316\332\251\234\355\363\276\246\277\212kG\347\031\337\331\335\317\353\255\336\207\303\332\365\254\262rT\365A[\337\031W~i5\205\373\276\240\355Z\357T}u\035\037\333U/\337\272uw3\216\325tW\237h?\377\335\343\321:\313\177\274\276\020\376*\313\366}\027w[\375}m^\247\366/\274\262\367*\353\323:\026\202=\324\326\373.?\267\277q8\364\233\207\230s\r\242\260\334\376\214\242\376\377\324\237\357\262:\237\355[$\264\262\302o\345\3659\256H\357}m`uy,\373\366\360|\277\236\356\215r\352\363\316\363\177\270\201h\274\255m\307\035\376\300\032\316\377\035\3662\256-\227\326\363\327f\341\375>\\\344\375\010\315\277\313\371o\320\350\277v\371g\273\265\032j[e\355\353S\271\357\346\375`\275\270\323\234\337\332\273p\367\216\277\366\372\367\036\332Tn\325o\315\026\253\336\367\255A0\344U\206U5\306\275\377\\\373\365z\016u\355~\027z\277\275\373\273\276\356|\177\377\260\254\362\356S\350\r\326\\\244=\032\017\301:\313\330\366\201\340\255\262/v\301\333\331\266\356\335\225\241P[\363\373u5""k\334A]\237\326+\3074\240\016.\337\216\327\376\374\366\213So\255\351-\253\374i]\277\261\312\275\357\261\255\322:L+\252\357\351\\\277\333\241\376\251\257\332\301\005Y\363\024\326r\214\355\247c5\033\337\332v9\224Y\313\277\333b\027\367\230\305\034\023\311d\334\303F_\013\363\277\265\235\346\217\255\035\262^'\3024k\267\266\337\327\275g{!\376\337\325\035\377\272\347\372\353\204\272\356\356n\361\357\334\331\256\353lg\363b\366\003k\337\355\306\236}~c\3743\356\241\3464\356\262\215\337\357\370\265\201\226\327\356\357\316mw/\237\355\333?x?\233\001mk;\316\330\323<vG\366>\335\350y\254\221m{\010\277\013\302\366\033:p'\357\020a\036\017;@;@>\257\036\020;\031\254\315\017\352\373:\035\307\036\207\203cu\267\305l\337\372\273\373\201\277e\232_\233\261Na\177\306-\215\343\214e:@<9\0350\274|trH\354\374dx\341\274r|l\206\033\240\227\215\005\342\360\341\245\223\203c\373\355\235\207\020\366\205n\215[k-\027\332\344\000\331n\355\220a\221\365\220\346wW\345\320\332\334\201\370\023\352pO\275\336\203\340\335ED\234\325q\262\031#\033h[hJ\320\244~\353<\303\251\232b\265X\254\321\327.\373\217c\256\333z\357Oe\215\211.\355c\326r\354u\371r[\250\337z\336\265P\023DSY+\356\337\206w\210\352\351.\177\221\316B\371\003\307\277\313\355\326\266\310{\242\177\237U\214\214\204\236\337\367r\233\352\201\253)\233\302!\177\376\033F\006\206\245'\247\247\346n\177\014\177\357eM\353\266\033\236\n\374n\036[\007k_3K\306\317\332\032\177\355P\2235\3270\323Q\373\336u\225\305qEaQT\350w\366\231%\353\334yXK\335\234\272\365v@\274o\335\302bUW~\"<\313YI\240\360R?\343OUqh\236\353<\021\277\231I\245*+\325\222R\255P\371j@\251\324\325\313\004\231V\245\241\351@\225\212[\255\202h=\353\032J\265RMh\251J\250T\035\352s\250\241\205\202\213\313K\013\212\323\372\r*\361;\\U\326o\354\251\300\260\337\332\367\023e\255\373\177!\007\357\215\255\347\025\363\301\266\024\357\237\357M\347\325Uk\352\212\346?\235\352j\261B\311\360\333q+\225\013\025\332\025\231\363 \226\004\030VP\211\t@\272s\253 \024\252\004\215\312\365<\026\362\332\273\377\376GE\303\275\216\025""\312\332/\342\206@n\325\"\010\365\336\2037|\367\216\267\r\n\365|\353\0143\215\323{P\225\205\322\265\373\351\240\276[\303\371\272\270\264*K\002Le\361\331\1776\247*\307qA\024Z\255\227\312\nb\016ll\340\221\302\306\007\243\005UR\213\203Te\350\206!\002*Sv\362\222\006R\025\310\211 4\350\006\355%\201:\352\210\031\216<6\220 \240\247\322#Y\343\202\215\027\324d\002\225\014\310\323\271c\266\314\010\025\255\017^0`\342\310Gz\317\232\023\364\344c\325 \205D\245\240)0\363e\302\234\240$D$$S\271\032AG`d\n\002\024A\031\241\204\360\341\321\255\n\240\031\222J\024\244\365$uiI\037\240R\2309+mJ\2152\001\347\222\246TlT\322\224\264uV\200\200BX\200n\244\247\233w\026\2311-)\354\366\272\341\264\240\267\344\032\240\020D\004\033H-Rf\0140&\0207\222J1\270sE\351\362\221Q2J2\335^\251\364u!\345XR\010+\251JJ\n;iRR\234\233\364\005\343\005\343\2226$\205\321\3444.\360HA\016\244\"!)\307Fz\305\010\"\213t\200\200\214\216R\313<\021D~\214'\323\002\tb$\022\023x\234\020_\304>\226tb\205\022O\322\202\222\264t\273\300BY%i\353v\023\001\215\240\201\232N!\"2%\202\212l\244\035\034\032\"\210\006\322P\331\342\221\336\030<\021P\026d\312\204\"\340 UHV\344\227\266F\014b\013\030\0044\220ZH\006>\322\322\230\342\310\300\006\322\207\330\"\003\220\225#m\225\020L\250\211\354F\007\004P\002\245\tu\"QC\343I\311\304\330\340\0035\231%\363\204,\221\tF\023\256\361\304\321\207F:C>\370@\r\0108\032:I\316\316\244\225#\345\004\022\003L\3349j\035\0250\t\230\t\312\024i\"O\006P\003\033i\251\374!\037\220\037\306\331\020yC\206\2209\243L,::\260\221\232n\023\316\323\351B\241&\262F,p\264\241\221\236\216\n\010\310\030\220t\315\242\262\305\004e\300\221\361\222T\202\321*O%\317\330\032_$\331@z\225!H\244!\363\232\023RP\021\243\310X\002\222\"0\245\267\204\225,\nP\005\036\251iL\2111G\036\034\031*I-\362\201\006\332*\021\224\034d-\200\026\320HK0\276\025\320\3138f\255\225\2516\303\345\232e\344\220\333\014\233a\215t,\207\0315\233\261\342\251\254Z\243\003\336\035\342G\306r\231\031\036\252~Tj\25553\273\203\227\306m\004\033cU+5c\265\342\301\326\243\252\263\375""\035\\.\035\227\253\202X\205\345\317C\274\303\357\327\003\303Ow\256\206\353o\206\243\331\036rk\223u\030\354\372\363\362s\376v\177\336\367\343Y\323fx\363\337Vf\364\226\350sX\013\271P\3674k1x\273\030\376,\247\301\337\240\006\277\333an\243\201\266\303\366\202\027\344\336g\375}\337\027\346\317:\367\242\367\254\325;\364t\3065\033\263\335\0328{\320Z\013\206BZ\177F8\247\022@i\033OJ&\315Li,A\272wt\340\341\321:\352\002J2\006V\001\005\361\000E\371\310@I:\305\3409s\014m\254 \206h\244>0T\350V\341,\240\201T\243\300\024c\007\251\024\322\231\032\n\324\214?\242\353\206\252\034@YI+t\245\201Z\010\371h\231\030\312\025\027\267\3444\320\222\251r\324B:\305\210\271\025(\2318%\013v\233\235\003B\314\234\0341\304\021\321%Y-\021\303\221\207F\307\031MD\240#\003\002\302\004'\205\024\240\026\"\001\226\231\022\004J\010\032\302%\305LH5P\230\010\341\250\243t\343`\302\254:N\231U/IF\320\033\221\202Q\322\217\017j\341v\243\201\006u\264\310Z\200\023D\"d\r\200\013I3\025\322\225\352T\317\023\345\016\3155_\304p\241\201\304\202\262\220\240(f\313\0045!P\342\234\230\316\222L@\251ba\032\365\023\013*\200\000Y\005xHC\251\210\204\023\3350\035\224+7\245}\2352\023f\356\224-F\222\2614\332\032\220\244\245\016\244FM\210\007\352q\033:-\260\320\025\220\226\371bz =H`p\272\2550cPP\217\221F<\211\374\026s\262([N\320;\24208)\244\320Kj\0305F\032\0242fdpJ\300\221\341Q\266\200\240\253\027.F\022\250\210,\000\001\031 \232N-\024R)\206\204\033\202[\352\3441\305\000p\342\230\036\345\020\351\000v\203p\0028\023\2305d\037O`\247\2003\346\200\004\n1d\336\230!\246\020i\343\242\000\014y\"\203\304\227;\026\211FC$\211\321\301G\253\374\331h\300t\266\224\037>:82DF\030$\231\240\016\024,\270.Z\345\202\003\0062\020\320\260\240\"\345\352u39U\224-\016P\026\331AD\211\036G\tV\272\022\214\034\2471F\204\364\004\214\nL\024\323\244\002@y\362:C\230\020F\310T\311\034*a\312\023\265'\251\206F%\245\325\201\314 :I\025\\\251*\265Ja1:\334s\3009d\306\234\320\023\203\364\306\006\251u\223\t2\235N\323i\242d1A\273\3503\"\222~\244)b#\315\005\200g&\305\001\235\263!2""\345a\272\334<N\031\024\024\305\224\232\322\327ib*(\031KL%\350\002\026I*\351\005\013)\013+]Y\241<Pi\224\252\027\251q\217\014p\230x\244Cb\210H?\002Q\221t\342 \225\211ISPR\324\251\001\003\244\027\014nB\tP\251T\335q\300\030\023I\310\027r5\232F\025G00\302\361\004$\r\201\361\215T\005-2\331\200\235\272l\215\253\322\205W\311Z\200.\270\347\213\362\226\034*\347\247\20192#C0P\320\340\224\276\314\014\245\311\001\364\000\371\222\021\003\210 '\354t\231,H\222\2278b\002I_\343\212\210\3405\206\214\335=\212\360S\356\220%D\222\02294\302\214\"\351+\206\354\006\273\345\234P\021,\222\200\374\010\033]\036$\203\261\304\204\010\023\251`T\020\211\201\250\2242\352\364q\032\205L\325\014 \200 \010\000c0 X\230\220l2\236V\231\351\003\004&\216\221GLc$I\024')J\031K\010\001\000\201\201\t(\200\001\000\332\206\000\226`(\346T\362x\250w\270,\2447\247m\030C\007|\220)\267\031,\223\330)\203\323\355\373\306/\353KK\355\345\220\277D\367\344\306\313\024\302\350\222\021\332\205R\031P\276\331\017@\031\3152\375\255\311\365\357\307\315Y\244j\023\201v\225$\235c\257\307(\177\351\006z\202\241U@\213{\021\240\255\034\367\376\026\303\373\300\210\037\324In\210\233h\231\013\272\350\03429^\216cU\24115\207%us\024\3126\216\344P\373\336\007P\364V\t\002\222\366\227[\201r\303 \350/n\367\247\264UKa\312\231\016\232\260l}\010=!\270\203\353\027v\235\373J\205=<\373\322\\A\224\237\241\345\024r\323e\n\n\2504\242C\323\336\314\356\270\274\2628QF\300%`\257\344\211\242\307|\226>\322\024\335\317\270\316\273j\031a\333\225\301#\270\200;\350\001\324\275a\263\250\203\324R{\234`\315/d\340\240oL\304x/vS\2740\266\361*z'\253\354\346ul\244\254T^\241\245\360\350\031!\346kKH\002\037\207\206\221|\271\222\245\214=F1\354\262<\313\001\341#.\272@\364\273\021\345r8H\213\006N\240\017e1\224\034r\362\205\342\230\004\353\250CC\275\026\007]\306V.\203\236`0\335\363\250\032\363^\255\2608\237\021n\016]\310\375c\320`)c\001\2738^ocn4A\030\252g\315\320\2433DF#\301\3048@3\322L\373UW\300\3060\24142J!\025in%\323*\271;ja\273\305\201V\311\336\"/x\332Z\006V\266f\314!\242""\022s\0209T\3374\010\232\356OK\005\236V\377\022\230#\313\205\010\223\336\361\301\332$\267\334Ht/`\333\215\014@\306\027\2349(2\276\036\001\307\324y\207\014H\261\341\213\346Q(1g\203\031\332c\331\371\240\nzN\013\030\317\357\350\301\333\006|6\212\370\266h\2068\235\352\035\031,\215\211\224\234\246[\324(<\032\200\216\246\370\347\344\236\030\324mH\232GSi\221\004\232\300\270~Ro\215\234\202^+9A\321\213\r\326\376\017\253\246\317B$%\227\237l\270\331\322.\036\004\237\033r3\215I\343%\360\317sK\2303\372\000$\205;\347*&\013\352\315\327 \001]^h9zZ\311\372eC\"\260;\237_(?Fh\330;\332\026H\354j\006z:\304\207\317huV\n\3561A\026j\240Lmi\301\335\276$3\310n\311\327d\203\242\267\013\250\006\010{\302p\017\026V\\\217\223\300\347Yw\244\244(\326d\255\325iS\036v:\362\250\233\024}\311\265I\257\001H\355\006S\325\034\302J'M\303\036\277(\274S\276\204\205\324\361\2432\240\037\207\221[\036($9\306\214I\2468~\340\336\014\2170\311\365:\305\241lz\244\343?\366\264\277\267\301\260\034\023\023\362\000\210\241\250\230\2477\242\337\370\177\235\000\025\020\n\002\014(\311\377c\240\376\370!\304\213;\n\334\365^k\223\027\317\310\251\230n\264\323\375\343\344\014\\\304foQ\023\003j\001,@:\232\0345!\220Z\216N\267\026\006YV\211\353\002y\337/\365\375\353\025\227T&\274\302\323\361\366\307\273\2125\275\006q-\0065|V\2143\325K\250\027k'EbF\320\316\333\211b\370V\266=t\"~\375\343\323h\312\376\323d\3139P\002}\034L\214\236|\365\t\247\205z\t\336\210\335\2546\022`9\030\250\320\030B7\261\201\325\"G\206\233\312\013$I\231k\0133m\217\036\271\322\210\206\203\006Zh\000\035.y\330\344rV+J3\230UA\371[\362\016\347\323)\217\304\272\343\214\toa\212\325\233@\342\214\375\352\250_x\221Ek\271X\361\310\2256#k\017\270\240:\334\005#.\211\231#\"\0132\210-\000f\366\361\247\033\267\370\366D}\304\311H\340\301\300\335O>8\0366X\013/I6\032>@\005\320\345\227U\016\246\354\343h\275&\3568\005\254X)2\013\270\333Z4o\264\354\255j\3411\347=\224\257\t\260Y\221ob\244\222\234\301\360\253\016\340|\370\303_\001\276f\006ldL\035\320qG\217R\275o\2663~\347%\013t\r\333""\342\027\337\r@\036\215*\013\223\304\007\216u!\010\227\232\220\273\265m\255[\260R\244\275\374]\032\3774\311\377\306\215\037\031JE?\310\224lFn\025\213\373qQ\016\001-Y\351=\265\350H'\346\252\257\201|\\;B\nEe\274Z\022\302D_<\220)\321\376K\356\217\271\"@t\205\2731Vi\341O\240Y\341\023^\276\213\207%\360\326\354\312\313\220\374\327\354\000\"\206\376C\302\367\225&\266\370\002\255wEqA\340\203\005g{']\207(\334\205|cT\306\0317?\220\035K\027\320s\3263\371\341\201\244W\272\344\335M\311d\236\214~\243-\022\332\030v1 ,\367T\204\326\373y]\316F\365?Gl\213\362\233\277\346\243\226fj\037\310\230\371\223H\240\307}\000\037\005\222X\3249\370\001\321\323\003g\2736s\307Y\207\t\022\256X\334\2733\rL\217h\365x\"\356\373Kv\212\t\316R\033K\235Bk\005?\362#\r\356Q3\303:N1\200dK\226\277\344Yk\306\355}\361O;ORL\260\331\354\341X\260\310\033\tM@\372\230\273\201\271\2506\217\305X`\305\026\353\264\317\363Z\252\224\337\257y9\256Fr\232#]n\3321\t\260\234\030&\206\303z\036\364v=Ww\200\307ah\215\262\253\330\250\242\016\024,\013\266\243F\376\242\267\257\310)\n\360\250\310\337\277\372\315\2052i?\3763\240\247\206xX\031\251c=\333\213$\2036\214\303\010\3075\307\274\t\035\017\210\001\201\237\344\204\250!{<\2556p\002\270\365\202\306{t2\004]\202\204S\230\006\346L\234\326d\023\2141\346D\261\272\203)\303\355\2222\003\250i\313\211s\315\364\221sT\336\016\364\326\363x\324w\033\215\002\250.^0\tU.\304\0263\013f\333\243c\177\023'\260I\202\020\331\224\211\207(\310\033\005M5\024\377\2468[h\005l)\363\300\035O_)\276\231!\222X&4\210\235\213\220%*\244\376\235\276\353Md\321\017\330BQ\244\370\025\373X\322\262\351\216\207x\321:\013\204\217\006\260\302\036\252\320te5x,\240j6;\375\235\315\341\362\336\324<\032<P\260\372\010w\231\213[R\350\233\342\013Y\204\324\253\376\234\t\231\261\007 \331\242\360$\n\377)\022\014\265X#\2524-\336\306\374\034\215C\003]i\017\356\251\264\367\365,\017\032\374\026\352\225:\r\026\337\363\211&\245\031M\356\035\341\256\374\211-Q\033\tA\301\330\233\376q\256\035\244\372\037+\032\334%\215\204\346\332\2360\032\366J2""\361?VYC\t\205*\340j\277\226\357\232\326\242M^\220\250\022\231^\333\273\345\345\007\324\313a_\265\201!\025\017\201\211\032\000\311\270\247\035Na\353Q(\346\363w3h\331\034\306v\273\307\r\367\340\342!\004\220!\300XQ\003&\036\357\252`\352\036\360+\233\212#R\020\340\3707\270KMx\0230\300\353\036\313\214.\244\311d\020\223\0102\272\200\266\231\372\314eP\206\310\206N\262\202\020\006b\005\374\177I\233\265\004\326\026\"\362p\016\020$\346t\234\351Q\322\375\336\306\324\3322^\0029\320ng\275\266\035L&\t\244O\212?\275\263l\214\002\301\027@)\000\370^w\010\366&\037\324;\003\237`u8S.@\344\327h\311\234\211\362\300\020\324\260\307\201\247\200\273*,&\000\327\245r\307\265ds0\030\341k\007]\244u\206\322{\234\212\366\320B\307b7\262&\267q\315\300\361\275#\300A\211\257$@w\024W.i\016@ue\272\343\202\251$\332*\037\307U\315\324c\315\217i\354\230\007\326x\032\262\262\3221\023\371\3243\001\260\3046\"E\261\300\300\234\241\242\243\330\333\325\231@\013\235(R\230\333\t\233Mr\333\364\355\237r\"\262C\006\341SY\232UU3:\211\274\007\337.\027\003\217\212iv\3376\005\313\236\007\246(z\314\205\003q\271TF0\001W!\252\025\317R\332\370\215\266\364$`E.b\373\005\256E\352\017\327\213\377e\226\234~c\321\245\034\006\274y\271n\367\325\341\243)\0025\025\353<g7#\203\024\027%\340,\215\037X\215-\362U\014)\177\335K\230@Q\232\354\372\375\207\300\030hr`\023\237\343\246\205\024\235\373\301\276\"\275\024\216\033\246F\223Z\247\327P:\332\207q$\004\204rJ\247\221\\\013\362V9\005\234\022,t\245\013G\305\274\275\025.d\000B\013?e\004\332]\357\372\342\\\211\352^a\322\323\362\310\000\277\216U\024\346\277\244`\270\247\022\315re/t(\3453\035\223nvef\225\020^\340\276\246u\231Z\000r\311\307\374\2139\356q\221w\241\25516\245\353/\341\251t\320c\340AJ\016\2120Xa\001\264\305H%-*\033\306\215\362\240\217v/\024\242M\371\276\334\344&s\235\251\352\0174\241\243#>\033w\003\375\340\236gr\370~#\303\307\246K\336$s~\235\002\202\306 RN\245\356o\234\321\010\177KL\265\221\016\335=\254=\211m\256t\037\227\033\271]f\302\036u\227Ok,\375~I\031\2145\327\352\367\242\270""\033\024xu(\266\242\206\005@S\215C+\255C\344\332\211t7\203)\362\373\341\370Z\037Z}\264\344\235\201\346\362\206\276\330[~5\022\266\366\003/\310\346\033c\341u\020Q\021\232\377\346\035\277\357\271b\334{\210\264r\214\303JA\325G\026\226X8\330\265\374\227v\360\0044'\211\003\275\224}g\305\260\020\023\034T\223\222\350\256$vY\276\314\356z\346Sg\205\321\314\252-\376\241]\373\246\004\026\275\251\240\342\355l\026\345\021\320\371\003\267\372\036\000x\216\025\2046\365\246\033(Qc\230fY\246:\nx{\177\376uh\254\341\020\257\347\031\274|\276;\020\313\305\312\241\2561\221\352\356\215\312W\000\337O\030\244\303?\235\337\236j\251\265\036[\377\321\232D\364.\333\27376\246\232K\3232\270\211\265\244|-\016\300\030\001<7\313<U8\230\\}\313 \3460\341\307#\214U{FFi?,\274\003\333\304x\023\364\362H\203\215\316\345\rF\272o\240$b=\215\343\250:\304\307V\022f\001\034@\233\332!\007Z\206{H\225\233\021D>b\311\025\262p5\"\"\026\266\240\376\261\237\345\233!\334\303\343\017\000\210\303\203\223 \032\211\263 \237\020\024\370\261\211X3\345\025\035.\243\035\362\255\211\002\024h\2446\250\211K\"q\032\177\256\235d\240Z\331K\235\037\252L\002\267\031\206P\272\035\"A\217\027\215\n\005t\221\262\270\333\033e\336\352c\236@]\275\030\326\222\025\304\315\355\027\210Vk\224\222\335\317G\277\017\004\310\204Y}\302JP,\002\272\255\212~\216\232\223\311\326\026:\326\210\257\315o\177\360\t\261\203\365\014U\r%\214\030\353m*\r\323\016\240\273\2467\201\301\376\201!JP\004ceL\235G'\252=\035\272^\033\353\231a\306\200\276\\\246\276\255\236\351\306\204T\212\243P\336\200\263\255\034\3018w\260\316GN\\\372o0\272\32712M8\243q\317\201\340\346j\035(,\277klH\247\334S\266%\205\004\343\202\t\243bRQ'a\367\023H\004\352>\325\346\373\253\316R\204\372\322e\360-\313\241y\331Hlg\207%\375\211\366\005k\303\366\320\324XE\027\364\356\007\215\254\242?6d\241\341oj\352\203\304\036[\256kQ1o5\315\213\334^\\\016\341F\363\272\217\006+\361\327\241\205\306\272\272'\331h\245\242(\312\364\006\351K\004\216\234\322\215XRB\032\003\330\017\320\202\016|R\221\252\2765\301\330""\217\252\355)\236W\000\215\252\347\336\217f\000Y\362\267Zusc\240?\302%\333\364U\211\032\316U2e.\322\252:/\r%\2178\367C\224;\306\037\003\017\313Ou>\317\3338:\2526l\016-c\224\247\267\316\342\237i\270t\274M\013\253\356o\000(n\\\356\325y\3145\201\202\005P.\352\337\332\320(b\210c\344\301\312\377-\232d\014>\342&\364\243\313z\360$|\360o\021mw\231 \332C\270\273\2772D\202_\303\231\254\020\347\322\321l\364=\350\334\302\367'\330\t\254\315\"Nv\377I\206]\311\257\252\321\353\316\013\371\335\324\223\363\0134pk\355?\267\266\034\361)3yxd\334\364tF\3145\034S^\325\365\024d}x67\342\354\321*\241\216\350+\037\316\016\362%\243\2736\375\347\304\016\314S\016\252\346\224Z\215\223\004\270\303\006\240\364c\230\357\210\247T\245\332|U\210!\274\275\243\232\334{R\221\2077\340\203\321\322B\327\361T7\210\261v\316\245\306B\237:\340T{\366M\007\201X~r]\333\255\323\003\361\005\206G\233IF\222\304\013\263G\002\273\342\002\376\347^%\254\215\005[\317\275A\206n\244\022\202\226w\331\220\277\332 |\252\331j\200\201}\261\211\242\215g\n\315\247\032`\262g\370I\333\274\016,\353h\237\245\014\271\027G\315\0103V1\271\304\370\361\234,\231I\256\304\2138\3011\224\362\354PP\207~S\236f\267\336\316*F\242\004\303|\306\n\200\366I\266n\216\002\010\206k\333 \007/\326-\032PQQ\324,\244)xFK\217@\3020\215.G\016:\320\322P\305[\367:\034\246/*\022\017\010x:\004\203R\350\203\316\200\252\360\377\201\262\247\255bV\376\376\001K\325t\nC\363g\226Xc\206\321\013\307\324BK\027N\024\215\271\212H\271\022\017\337\213\303['\264\371\275\320\275\t\307\307\214\234S4\235\203\360~d\232\310l\305\r\325\313\332N\344+:\034\202\244{\014\033\362gq\342j\343\3306\307#\211\"\243\321\351\311)\314\352\245\220\234\311\351\032\2433`z.\307\016\321\004\"\274\307\034\303\251y\242\262\256\363\022\"q\351\023J\200i7b\300\003\307\354\332\246-<Y\351(\303\3047\304\263\2466\006\035%\0019\244\010LJ\024u\363\342A\310e\006\332\305\r\033\272\204O\276Ir\022\310\203,\252\300\3507\341\231\202y$\232\254\256\237\306\210&_E\200x\021\365j\3421\343\342\\\006Y\267u\0247yq#\345\202(9* ""\302!\330\267\n\331\364JM]\350\240'2\312z\336\304\356\022\2249U\033\301\252\240,\tJ\261\364J\2434*\034E\034\375n\273\264|) \021\222\262\344\337\353g\320.k\026/%(\017\273=Gd\030#\221t\313\352\210\364\246\212Yx\"s\33373d\210\365i\365\212\037\327\326`6\360\231|\340\253\"\237\350\337N>O\246\347\341\017\313\304\346-|>\257\005\352\331\021,\005hRR\313\372~\r\346\013\037\270\312R\313\227\000&\037\215!\364\221\367S\035H\301\240\246b\235G3R\035\331\364\376:\335S\306\364\243\200\363\033\202\372\254&\n>E\t\374\204\216\230\361\013 \217\016P\360i|>\234\233\306\357J\027\261\026\227\307\035;\313\331\370>#J\0017@A\207\326y\t\t\023\216i\360l\227\241\030\271\265E' `\240\321\370iO\t\256\006>\"\220\3026\201$\212\271\351c\001<\234\006\217\272u\264p<7P\273\331\234\207\317\310\316!%\313\246*\242v\361\326+>7\213j\t].\024\032\320\356S\314z\222\236b\016\322\261\251\214\226\333\247\341\323\001#\335\313O\251\343\255Q*\213\353\212\232\026\"EDJ\377`\252m\363\340\306+\216\377!\231D\250\316\230^\306\230S\230t\316s\"\233\031\325HB\230\255\357\362a\023y;\252\3002\206\206\346\273\200Mw\372!B\223\304\265\226\300\327\003\344r+\261\300\3647\220>S\370\344S\214\014Z &\223\266\255$\214\354k\353l\355\276:\220%=\312\322UZ,\245\034\273\266tE\221D\2269)\301\376\206j?^\222K\306\213\347CK7\2470\347E\201\351R\334\002\203\237\233:K\367[\225r\255)\366\270t\3464\243\0351h\201\333\035[ix=-!qG\021c\244<\365Z\206\335\227\037\232\372&\270R\323b\355\346\003\350\335n\314l\375c\274\374\301Rq\253\215^c\306\251\026\362\3437\226\254\335m\321z*\311\016\360lzh\307\024\010\351e\367G\334\357\302k\206~\3231\237\367\223\261Px\306\312\321\260\300\264\362\017\344\210\302c\030\010c\243\250\277\252\3106\313Q\353\021RV\261\2004\202\r\241\240\004\246\271\206=\"0\317=\307\024CG\336e\225\202\222\200|\324\255\350\0245\321%\350\313\031\337\223\260wSc\203\247\216\302)\037\233\217\267d\350dfO\334cNw\207\364\232\276\336E\"\300p\336\345z\231l\037\204\2556\321\207\244\314p\025\264\202fU\304c\201\255a\302\311_\370\260\350\353\230(b\013\026\270\206""\037\334\337{t\026T\n%!\361\245\263\235A\240n@\331}_\025\031\025\321?\014\231\203\205J\314k3H\244{.\301b<\367\303\222N\022\224a\367A\3031\356$a\206(-\246)\307R\325+\267J\316\251\3250\261N\224\275\246\312\321\250\324x\2513\035~\317\207L4O\274\361W\003\315W\213\300\326u\343\0016A\023n\212s\257\3469X`\321\310\325\300\311\346\375\247i\224\261\315}\333B\350\373\237\362\314;\341\222%OXq\247\247\236\204\010\323\363[\222kc#j\031F5\2709\306\321\326\342\240j\372'\354\336f\t\022\200>\240\354\346\227\0142Zm\362#A\350\375ty\333\317{\244\363\336\344\320\373\271At\030sNw\027:\234\262\267S(PI\374Gk\206|\250F\024\3001\377\217\251\250\222w{\300\254A\276\215\254%\246\245F\233\265\262\366(\366N\241\204\203\271\3547\201\3661r\026\"Q\342\277C\273\ns\270s\363^\212/E@u\352\031V\003\267\307\212\007\031eC4\343\267\232\252\\o\270\341\220\332\233\200\342\355O\023 \205\330r\376+\234\037:\004\027rG]%\345\222I\274\361m\020]E'\230j\312\311\321\212\t\2430\233\335\0331\344\236X\237H\314\"\272\367\300H\251\262\227\217jL\331}I3! \225[v\312\254\314\007 %\031\007 \362\233q\341p\316\366s\234\271\311\334\316\345?\245\005v5\031^\267v\\\350`\377\264\006\r\367Jq\364\021R-\362\350\327&\371\232\336w\025\264\222\275\241\265\266`)B'Si\002\211\244\267\0257\035\245\250<\005M\226\206W\204qX\3515\237\225\002\246\322\343\250\3562\233L+_2\232O8|\030\024-\035\3464\0312\321\214*\256C\317\205.\252/R\205\236\257\341\255\221\263i$P\331\033\020;UM^x.\320\224\031\024\0364,`,T\325q\336\2052y\354M.\310 j\365!\367<x+\311\022\3639&%\020\271\013!:\035\225\250\333\330|\177\301\271\227\355t?\242\265h\265\231\216\022tn=\036Gt'\213\020\247I\317\245\177\222\002\301\311\253\tU6*\336\371\223\216!`\024<k\033\200T\341!uh\365\237\240\322\217\340p]N\206\207\361s\007+\204\3169\213G\267\375\215\000P\034\204\221C";
    PyObject *data = __Pyx_DecompressString(cstring, 8272, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (8101 bytes) */
const char* const cstring = "BZh91AY&SYms\306\237\000\010\224\177\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@@@@@@@@@@@@\000@\000`#\366\366\365\036\372\333\265\220\210(\000\353j\364e\336\372\347w\271Et\356on\355K\274\350\3210\024\364iUT\035\225\262*f\220\210u\220\240%\002!}\031}\206\373h\372et\336\335\314\025'\321\202\367\316\360\345\330\2205\237}eP\224Bh@#LL\232d\004\300jm4&1\nz\030I\352aO5'\352\2364\320\321LmMO\324\315(mOSL\236\247\241\232\247\250\022\201\032\010@Q\212\214\324\311\2434\201\243\021\3512f\240hi\352i\241\220\000\000\r\032\000\000\000b\003M4$\232\211\350\023\3257\245\033I\243\324\3204z\217M@\032<\321\251=OD\000\000\323\3244d\r\000\r\032\r\000\000I\245\020\204\304\t\244\365=\010h(~T{)\017Sj\017SA\240\014\200\310\000\000\000\0004\320\000\r\002E\021I\372\204dzFM4\320\323j\036\241\246\200=C\324\032i\240h\364\214\236\210d\006\200h\000\321\210\0324y\020\004\210\210\000\232 \023&\200)\355\020\364)\246\325<\247\251\342\236\210dmF\232i\246\200h\320h\000\000\000\365\000\030&\376\033\365\220\3435O\007\261\331\214\303/\204\305\241\203:\273\275\375\265{\310\362\265\250\375\373t]\270]=\313ZZ\356;\335\243w\022\016\265\340\002\030\261o\211\371\345\207\270D/\237\234z_GC\344u\321y+\212\3667^(\0309\275\212\206Fw\317:\020\256\230\321\255\241Z\252\252\232\254\"*T\032:m'\247\247*\216\252P\222\004\260U\204\024\265\002l\320;\252\0348\375|\026?Wd\343\307\240\017\375'\324M\004\205`+\365\016\314[\001@D \250\210\204\314\206\004;B;q\321\274o\374\"j\027\232\2369\244\211L\227LF\004\3459\304UX\"\261\021b\300P\024X,A\025\025\200\240\242\202\305\030\240\363\204\014\356\3078A`\010\3062#NG\017Y\276|p\375\020\367/\322\367\333\350\267\353]9\320\364\2131n!\360\375\363\345X\177\347*\006\310\351\313\361\361\177\270\004\350\332\331\010UG^\004\3663Gc\250\377\213\251\341\364r^\034\314\253R\327\262\225\337\306\271\006\022I\334\2775\362\347\311\027qZZKM\256\205&\033>YT_\030\310o\027\366\231{]\321\037\026A\025a\205j\271\333\310\231\310\026\034d*\210+>?O\253q\235\024}>\257PE\201\026)\010\306@\005""\201\300h\026 \252X\313\317s\014,U+z\270;\243Hc\302\030CD\0203a<\"\243yj\210\250\020\2057c\tb\304?q\014J\007dP\204C\021\212)\003\347C\256k\000\320z\002j\007$\n\237?\247E\rETU\r\374\r\376C^\372\356\027\202x\240s\022Ly\013Q-$\324l3\263f`\202\223R\204\250uW\224\211\222W\343D\217\t\r\346\213Dff\201\214j\334(P\371\203u\273\250\205\301\336\365\323\035Kl\315,\003\005\222\253\301-\226)f\346\355<\354!|\024\300\203*-\356Y5(\230\356\032\2312P\240e\005\3061\312t\262\t*\242\250\273X\262\026MB\372h)d\002\342\227\272%\313\221J\312\364\346\nj2q\207#\030\363\370\247V\201^+\231\343\223\320\221*!\362d^6\347\316\206\247W3\\\"\032\347\206qY\324RO>\354\252\276i\tE\210>So2\231\351\264\016+\321\321r\300GW7\026\374\262-\373k\217 B\016\306\010H= /P\304$\230|\t\033\007gj\373\355G\275x\022\376:z \377o\222\275\272\"\331\255$\365R\331\373W|\341\272\226\013\342o(J\307L\337t\2117A\275\205J\326VQ\246\036\312G\223\245K\357\032\225\206\027\221\215\031\315\313\306\270\361\243\340\217\034_W+@\207Z\215a-\023\001\241K\254\372\232\341\021 \273\314\021\r]\243\361\306\216\231$AP\230=;]\231\250\233\"&\334(\324Cumz\013k\304y\007,\325\246\365)\214Y`\365%\2632\214\3345X\307oM\212\220\270\364\203\267\344\260\234\367\235r\255*\327^\\\030T\244\014m\244\252\365sd@dU\233p\353\006\034|\r-UD0\314zU\036\271)nt\207,\346}b\267\023Q\353T\226?\345}M\235+\223\331\346t\341}\002U\226\244SNR/%O\273\305ht\365\244s\327Y_\032\224\277-\307\002\220\331\242\306h\271v85\331\215\263\221\335tVYRt\305^\260\210\235\342\360\212JUh\354\222\272\313J\326\360\362\364\314#\014\035\034\016\3531l\026\346'\022!Upp*mK\352\2479{O$G\253\257\022\367\343v\240\306\314\2617c/=\215\032\367\244\366#^{\265\215\313Kb\007\037\005\351\366\346)\006a0\251\327\206Z \305@\030\035\335\356\252\360\232:1I\364\035v\033}\257\327v\261v\336\345\032Vh\357$\321%\2136b\326\025\213\035=\024\3507\352\373\327\241q\212\377\255\306\"]\021%m\030\270\320U]M\244Sht:\005j\225\340\372\251\303\246\256\353\256\234\367F\242\231\\hZ\033j60\256RKH\264\227\245*\312\3134C.5\371m\271\211-jV""\333\325\260\325RqJ4kf\245\024\320\225&\270-m\266\275\224\274\255\\\262\2543\226\326\265\306oR\265\036p\210\236ljE)\000\263\276+\204c\276^\023\374\r\263\254\351\374Jz\272B\227\233B\250/.\004\311\220B\332\002\220\214dS\333\203\253\245\245\263p\322oQ\233Z\237j%\244Kv\215o\242\335\322\001]\273-3\231\022P\367\310|;R\0173\314\231\314\275^\036\324\2431A\240\r\010\245{@\325\035\315\333\327\270GI\035\035\343\353w\373\316\317?\265am\225\255\372R\234\337w\303Q\366\30422\264\236\350/\225X\220-\375|\023\257\214\005deq\247\334\205\350^V\304\204y\270\312\246\250\206\337b@\214\014>k|{\3145\375\300\274\013\333L>\362\271U~\302F|\3264\235\243_5\246E.P21V:\343Y\030\206\304\035,L)\227Z\346\303\022\254\245AT\351w\357\360(\326\320e\000\275\247n\254\n3\334\031B\302\335b\353\255\0218^wI\333\014\033\t]\344\251Bf\244l\237\367_\346\320+\210FPAj\340\264j\031d\245}\335\2344\341\201*^w\340)\020\275\346\272\325\234\301\322c\346\214\307\365\263\236WH\351\034\330\225R\256\231Tu\000\246\001\336\226\210\3040%\006\324I0\274\r\235\034\321L\374\350\313d\224K\025\n\262\214\265\030\030\213\215Z\2662{9\334\336\0229r\031\2339z\311\257\221y\327\320\255\222W\352\356\257\327\212[_\223\321\206\323\247\021\236\245\253\t\242\360\007\031\277\2028\336\\n\222\230u\206\333m\020\324\020\231\311\237a\343\375\036\2370\373\263\372\350\003\314\227\230R\202e}\373\367\240\3544\300\353q\232L\314\223\352,\354\033\201\233\203\332\227Zef\346\345\020\334|\354\301\315\220\312Xk\267{\356\3211\354\352\213\253{\007\225r\331\245\235@\346\005:`\257\317I\241\n\245Kxc\rZUq\306g\\\232al\243\246\206\\i\250k\364\034\371f\031\346H\272`S\207k\332Z\0046\273\222\3532]9\263\005\230\013:\224t\026{\223\203\013u7o\316\206P\251\262:\264\312'\031k\246\214'\354\374\001V\335\225\276\325\r3%)\017\\s\247\241Jl\356\346\256Q;\307\327\266\3116\0254\301I\242\242'6\242\022^s\220_(\334\344Rr\334\210\201=\233\004\332\225\025\213\336uk\2029(\235\250^\346(\312\014\342\231fq\230\270\345\224UZ\211\014\002\314\001\003\263\261[\273\330%37K\3238\245\2602\357r\363""\206\203\207\000\351\010\314lU\006ApH \220\350\nN\376\3069GE\003\235p\246\362\357\253\365|{\202\237e\232\213\247\004s\013q\210a'o$\315\311\223$\247{ \253D\234a\206,\023{8O\252\372\202P\224\224\023Z\277jA:\244\352\213\271<\335\230\022\304\227NT\253\354X\311\364\247\221\224r-[\322\263d\256#^\232\364\2424\207\241\024LJ\024!Yg\254,\034?y\210`\273\307\334@|L.i\033.\215\347\213\202\335\230\313\022\246\313,I\223\354L\031\205\360\205\2175M\236($O\303\252x\317\021M\013\324\255^[\035&\255\027K\240\223)\345i\365~\211?D\231nt\265\202\0106\241\021&*\"SDN\336<\340\234j\3163\251%\"E\004\212-2%\265D\213\244\3451\177\251\276{C\364\377\002\235\257i\370\003\361\362\314\272\330\267\3263\351)\317\231a\305\022\260E\201O6O\242\333n\275\260W\220\350\005\325\002\214,\223\356\341rJ\241\353\206\006\272\026C\033\332\0025m\225m\000d-\346n\215\003-\360w\245\222\323\016O\274~\235\272u\352\330\217G\332\361\337*\312)\203\326\033\367\364w<m\033\275\364S\000\261Lz\035\255x\331U\22272\243\373\266z\217\217\251\026cdG%\214f\245!\316X\0311\221\352\255C\032\231L\246\233g\273\246{K\320\345\263\373\374&V/n(fa-F\246\021l\307\243A7\344[\324\t\030\025\321\n\350\306KLI\267\270G\270d{_\021\n \304%h\202\204\366\017\203\001\0205LZ\221\234\017s\303\273\275Q\2159|>\235\004\214JEV1\315\254K\207fx\326\330\223(q\037\311\314vtA\320\272=\034\345\206>#\216\0163\013\215\307i\342\371\347\2071\r\234XrJ\231\253m\235\202\307\260\313\263\27772D\214\365\222\253*\nR'\301\316\022\250\237\235T\305\225)\235fM\237\203}\326\3012=rqVX\222D\275\317q\335\362|\357{\374\247\246I\352\335\356\361\250\345\254\255b-\265U\023\227.\316;mZ\371>S\316O2\342\360\031\227\032A\347\233(w\352\255\364Q``]\210\277i\022\323L\313\22254t\234\022\335c\007\014\231\265x{U\314x\033\221rg\245cu\250(\247R@\362\026\020\276\007\274f\335RQ+\"a\232\231\312\3033)\325bW\253\321\272\355\221\203\006\2252\211\363\227\345K\272\250\233\275\n\3639(\177AS)\353v;-0\036\005\201\0214\240\211W\311\177\257|d\263\340\037\353-%\222\2113e\322m\360\365HVp\334EU6\261\273\226h\t\210\224y""\027|\370\371\203~\017\270\366\323\003\003\236\322g\303\360\361\210\354x-\266\271+\225\322I\305\214J\342\317\365#\262e61e\\]\253\217\243\354\013\305\355~g\332\322\trvN\006\0341\355\365e\241i\t\014%\021$\327O\372\0315\232\214\331\036\014\334\322\032\024\240`\t\320D\306\252}j\316\255\026x&\275\024\233\222?h\262*\300O\206\324V\"\230\214Fa0\343\372\2522\355\014\363\354|:\305\243\277m<y%\226\376\017\203\245|\266\323\347Z\026\302\354\357\035\372\036\226\373\371u\rQ\017\021D\016\2358\314\010\033M\026)\243\032\216T\033\264O\337Y\326\034G\314v\332\\\267\350^\245\317\352\353\257\030\367\t\0071?\016\266\333\203rl\256\346N\256&FW#\213\322W@\345\035J\212\\\276f,\270\337N\265\353j\211kE\010G^U\331\333\213(\332\n\241X\2343\32135\205\030\264\340\315\352\267q\n1\315hG<\304\nD\262@C\270\364\007T\212>N\342\220j\262\256\232\321\r\0349^\224\246\271\300s.\2541\261a\320\360\036\355\013\215\266\330\253\2460\3516\324\312!# \213\265\025y\020\000i\244#e[N\027q*\243)\303h\241\253qj\221A\315\264\262\202\017\266\347gw2\371\303k\374\243h\317D\244\354pJ\250.T^\034j\322\272\245c\220v\335\334F\014Of\2049\"\247\227\344\371\002\314u\233\314j`\255\260\"\201ib\200\255*\025\3002\225=\370\373&=\234t\262h\261\303R\342npm\261\247t\317\274;\366K\343@0\313T\221Q?\270\371\006\220\306\02445\014\222\000\346(3\250\351\333\036\357\307r\220\242\016#\306\377\272Tq\206\354l\315o\256\022R\373+\010\340\235U?(a\300\340[\222\021\200:i\313\177AH\341pG;D6\217\367\032\000\270\313\032\245o\332\371KD\205\357&K\315\337m\300\272hr\312\025.\264\321\003\267\360\302\241\031$]\341\3603\246\"\316+nc\006\212\034ry\001\026\010\370\231\231\327Ax\035\315#\206\354R\014\020\r\006@`\267\014\321\220\367a\204fd\262\000D\023T\360\311\260j .|\036\324\304m0KTzX\nE \311\024b\240\262Ed\213\307\350\246YDhM\003\032J\025\331\211\031\341\327\034\204V\267\273t\017\005\304 \245\334,>r\230W\t\335\351\272\242.\251\277\302\2043\200\350\005F\2303\336\367\276_?\2762\200CBA\025\340@~V\360\"\204\010\na\304E\0071\032-\213\033\365\332\230H\316\367XA\267\216""\257\247\013\022\261\007\235@%\351g\200t9\022\316p\232{a\365\322L\003\326\225\255\r\210U\265\0354\304.2\302\301L2\333\371\216^l{\371u\301,0k+\351\272\247&Q\335sw\2727\022\371k\023\303n\\\370n\267\354\277sj\313&\025\004d\006H\244V\0020E&$\235;Y\201\337\317y\277\214[\034\204\014\000\273E4\t\355\255\252\245^\342[m\2666\330\013\021\334s\345\030\006\243\023LED\022\326\231\264\261\300\"\260\000\343\013\311~\254W\345\351\267K\273\240\263\205\340z\367\337\023\014>\243K\332\374\263b\300\354K\023\235\244\254z\000\235-\310\224B\262,\r\270\254\t5\276\352\302K\214\n@\005E+\021\026Aa\255\201I\210\233, \210+c\233\2758\211\007uw|GYq\2130L^\030\031\031\203l\344i*\265\213Z\232[y%0\305\010j\014\302(\337\000\230\332\001J\216P\344\213\033\261\036\n\205\020\254\272B5!\261\255\010\261\361Sx\342\2724Ke\356\301\242\037t{T\232\371\364:||\216\241:FL:\035K\270\027{~?\000G\357\365w-\323\001a\002\205\216U\\\201CB\024\231\231@Bz\330\353\204\336K\260\263\2522o\215ueK\024\036\030Xc\003\207I>\243\241)\001\2113\347\356\256\303\262\363\243R\026\334C\221\236MW\221\236\337Q\337\276l\264\367-\253\230<\203\236+\016\231\247M%v(\232P%$\305\272\024\345L\235Z\325\3253\007UXX\261\333\0137V\214\356\221\226\341Y3\231p\311\225\014\"\343Y$\254fSK\351:\273\357\315&\330,k\002\275\020\325S\027\336\363\033\236\352u\373\246\222\372\032<\035m:h\023\014\317g-\242\304A5\347\276\255\335\270$\325\346\nNM\034l\247M\343\246zwm\252\252\214b\242\252\252\252\212\252YU\225\314)\277mW\023c\211\246\354\302UYP\316\253\265\305)T\326f\016Zh\031\327\240G`VP\027\345\002\262\211\206\036X\033u\342\032{;t\273\207\242f\30017^\214\320\014\342\370\320\004\016\301\032D\016\0340gPT\032\013\365\261uB\035\254\202Q\212\030b\322\315,:\242'N\026\257\326\203\327\332=\316\033\244!\264\031\020\324\353\265\366\256\264\240\200xJ\264\225\315\273\353\267\033pB\034\361ce:*\030nP\"M\374::O[\277nD\226\034\033f\341\240\007\226\213\026\t\200\267L\251\203p}\2610\337\\\335\234{@\230I\2435\213\026v\342\020\325zJ\234u\345\270\315\005\255\264 m\001k\366\014\265\240""\350\314\311uK\351\237\001\t\252U\016\354\274\252\256\363\232\272\3044u \315A\225\\\200\207,\001\324\251\023\276\261\005b\244\316j\212\305\277[\352Q\"\313\242\326\244\273^\251\316\372]*\212(K\r\331\206\021\354\226TDhJ\271\240\374!/\315\241_\300G\250\243\332\221-\215\355\225\tT\232uE\312o{\342\322\270GzMaM\017m p9kp\030\324:!S\316\312\243 DQ\005_n\n\212\252\262\263\201\035\0168\014\016\366k\246\272>\0242\204/\223\217v\227\346_\256\340\320\347g>O\233O\001+\324\317q\331t^\347\275?\360x\021\267\254=\007\240\363C\360\204\355`Q\025\255\250K\335\344\0001\342=\337x\354\036\313\014\302\036=\016\266.\034w\223\212&\340\333p\370\254\233\266\311Z\314% \202\265\202y\030r\326\204\331g,\320j\272\327#K\254]\255$]e\025\305\033rj\244\267\010\002\256\325\226.\005\316\311j\230\300h\345+e\246\352\334to\314\264\365\\\267\213\224\372?G\346\340\tp\030\032\215\tzx\343<b\205\017\010in\320r5\263-\r\302\274\301\014\225\210\322@\332\027;\005UJ\241\330q\332(,q$T:\317)\345;C\267\345{A\336\301AX\202=\214\"\225\202\331\016S\020\342f\345\t\363\006\000\240\2521\005\221\301\324\036(\235X5u\030\023\327X\311)\002\310\260B\266\006\330\325za$\007(\274[\367\3557\360\266.\216Tf>\270\244\265\345\024\005\300\026\024>\006^\321\rOM\236_8b\217SG\375\372\010x\207A\345\313d\270\374v#\225t\352\266\356\036\003\223m\310\207\002Bi\014i\025:P@\224\264W\276\266\347k\302x`Z3\332\032\362\346g&\235\306\325\276\010\342\230\327\247\017\222\360\226(\023\302\304\331\267\231\320#\204\347N\n<\202\243\210\372hj\025\214\214V\300#\213\024\270\027Zh\322\"!(\255\304\204\320\270\316\224\270J\316\006\343\213\223\221V\223\274\206\017\236\3703T(&|\334\303r\250\261DANPAa*B)\026,$X\000\262K|Gu\337\241\327\346\3538\211\356\t\003\342\320c\033i\215=\024\243\227\r\26558\272X\032\301\206\376+M\362\257\336\010\273}\306\271\272\263EPjlB\013\356$R\276\232{\035\010\345[\027$\374GJ@o\021\236\246\375\305\372W\351\027\204\360;\306\364'r\275\320\002\006c\364\365\354\362y\353\203mo\0244\332d$\307\214K\203\300x\376:u\2634\035=[o\337\261\342\tU=\210T\3234""\357\314\316\n\243\340\220\316%\004\202lI\215\"\235\263c\243b\264\271\203\224J\357qb\"\264\274b{2\3315b\274\226\200+\366\027\226z\256E\333\030\371\216\033$\256\250\031\226\2641\246\366\214\330\250\037Sv^\034w\323\275rTi`\2221B\031*E\210\003\277\2537\027\314u\330\211\272\037^SA\027\216\262(\031Q\222\345\001\275p~X]\032\252\245p\222\340Z@b\335\033\2423\277\024\261\363;\0034\227\231\227}\221\344z\265\356\3424\t^\323a\014N\267$\313F@z\244\344\222\036\317}\240\026\374E\230\tkl\026\250\032\024H\266\211**\361\330U\251+\020\261\305\227\tDL\035e\304\221N\213)\351\322\"\352\026\230\24635\315\311L\216\031X(`A\210|S2\005\204\014f\264\344a3\030\236\316\001\014\245\326\244@Yj\"0ySF5\317\n\034\325\254\314\roPn\232G\307\241\210\2073M \242g mP\242a\224\360\\\357=\2152\000i\303\351<\264\360\320\250@:\022A\227d\"\204\374\270q4\2060}\335\324$\234d\362s\316<\2218I\024TT\021yy\3158\2473\305c\315\263\215\261\212\311U\010U\020\202\311\014A\204d\354K\003\214\250l\243X(1\010\300d\205\006\006\031\204\243\256l2\310n\341%\327)\003@\2629\316\315D-\343I\260\335t#F\203\220:v\r\000)\345\251|\373k\211\036\370\257\206\260\343\275`\000^\275G\253\342K;\204p0i\032z%\001A\003c\026\306-\006\340\006\006\254\026`H\220@\203\307\260X3\\\310Mr\336\306\004\206\351\"\366\027\346b\001zxz\207\234\251Nc\365\2349\034\212\214\305\244Y!\334\201\317\211\3504\005\005\016\304\257\256\343\246\3002G\2038\351\005\206\365S\014\336\357\002|7p\316\315w\315w\360\340\036\215C\212\014 \311\254>#\250\234\301\216\335\000\300\021X\232i\266\232\341E\227q\r$\2639\210\345w>\025\273\312\2634\372\204\0274X_Y\246\230\256-dV\263\234\t\246\to'\312$\225\221g\251\032\212\025\305\324\373\211\360-\240\203{\036k\251\222m\244\276\352\225\263\207Jp\205\354\244_\006\256m!w7\322N\210J\013`\207\021\312\347C\312\226\363}\3025\275.v\035\240>\352\025\244Y\306\017%\006PaC\253\223u\211*ft\226\214ll3\315NX\227<-\025\203\266\206a6\024\246\271\2666@`wwl`6\346tt\331\350A\022$\005Tb\243\004\005\005\204\341 \355\261\354\024\214\036\322\360\317F\025G\246\221""\325\037'\336\027\250G&\232\017\255\321\202\345YK\021\304\204\303W\rD,\005\3045A\306\306\300\3471\210\330\035m\343Zx\236\364\211V(Z\350D\022\032\016\323D\316t\301\223y\346N\250\316t\n \242(\2520`*Ha\236lUL\005h^\342\312\242\244\230\014HYqH(\342\312\250\202*2\372\375\365P\022\010\200$%\232C?\367\346\002RN\322o\273\323\334\245G\336\204\271@R\300\270\030\334\235H\346\363\260\354~JA&\201\340E\027\215\365j\260KU]Q\016u2\"$\230g\205\326n\253\2653\330\366\232i8-\356.F\254 jk\347v\313\311a\301\022}\001\273\213\232v\273\2757X(\275\275\344;\310n\204v\363JH,!\214\354\320[\330w\022\007\333\350\343E{L\014-\025W\033\222\021\2360<\336m}\211'|n\363\250\265\371\356M\020\200\241\013\"dIi+(\253$M&+\010\016<p\23764\231\314Ed\221VDg~\274\2454)\355\313\200\275W\267u\323{[\255\345\223\200\205C\253S\010\204 ;\214\355:M\000\222p8.\245\335\251\204\247S\266s\307\\puvE\323}\302\361\313S6\006\232T\276\030\300\3006F:\203<\312\316\033]\327l\034\\\342\232\240\226\206,\273\\\361/\226\322\267<\342h\347\243\0020X\334\254\277\025(\263S\220\245\206N\303\220\250|/\257\205\004n\241N\330\200\240\306Q\310]\244\222\225a\025e)\277^,\215\301\2662\336\246\343N\276f\\\214\304\361\362\251\304^]\217M?a\202\210\202\2414\307\016\3567\027\351\233V\347~m`\213Y\332\341\240J\360h(\305\t\007\201\334\336*\365\333\241\264;h\206\206\016\276\226\203A\312\010\r&HP\236M\032]M\312\373\327\344\001\357\362\331\257.9\274^\236A\301\253\246W\233\354J\020\351\016\352\245)\204\260\2162D\023;4\267\212%\212\024\314\322-\242y\2304\203gfs\361w|k\025]\304\327\221'D\246\357\242\367\316\022\235\267\207\014\327\200\t\326\350\374&\030\362C^t!p\023\n%}(\3504%\331\265M\256\277j\242+Q\361\242%dmKN\365\226\3301\212\324\254\254\322\305[\211I0|\354\213K\324\324\002,QE\207\206\026\360u\246R\212K\rn\366\321\025\303\031\022-\206\310\217\205\255\352U\235K\241L\\:`\251\206i\211\214S\030\243\213Dm-\240\331vf1D-\221b\253 \3236\022\334\\V)M\022_\236\020\250\336\266^\334\340]\311L4v(w\226\212\021\215\324\262\312\216!\262\256\320a\223n\301&`Y\245\324\321""\330\313\301fqd\3409y\274R\276\032\305\267\t\337r\316p\006\000\206\201j\317~\315\365\022\025\001];j\\Y\006\361\016\022E\204\205\032-\025&\301`\311\276!\312Jb*\351c>\n \226\214\343\270\030\344\213\332\240Z&\020\0052\306H\033\036\035\354\"\031\256\232\342\335\2144\306\016\240\367Z\222v\240\036!s@6:\224v\331m\351\241`\252\262\022\024\331\362h\240\014\307\303\035V\346o\276m\227ad\333\316[\025\306,\245%\301\210\027\020&\n\3142\260\256\020 \262T\225\213&\246x\353\010\027T\361hxt\204*\023\316'G|\370\036\010\236<U\307!\211\243G\t\200\033\254i\224\251\252C\331\256v\271m\215\327pr\001l`\353\014\305\2310\306\242FB\335\315\336\242\270vTXK\"#\3606@\270b\272(\224b;5\202\004\344\254\222\002\331\013V\232i\310\240\333B\177@\372I\330o\2315\333\266\013\203\227\"\374\271qB\226\223l\364\216@\363'\240\006\036oc0]\275\356\213(\003\r\275\251\303/\032\335I\006\205u\026\306J\013\327_]\222u\214\340/\254\247\016c\235\312S\370\\.$T\352\353\374\275\350]\303\217\226\363wE\234\257#\332\356\251*\244\260\336@I\267\003^\025\367y\371\366\222Ce\211\017!\316\3734=\364\375\177%\t\247U>\026`\213\325\314_+Q\357\204\260\354\334c\032\204\370$\353\370\003\355\374<\017\021\360\212nC\275\030\243\014\037l#\341\223\022\270\203\004\025\021\004eN\216\023C\313\355\365{\243\233|\357\223\273l\032]n\3303\224\251\024\205\237%2\225d\214\207@\303V\036r\023T\023,\231~`\367\372\203\2441\263\270J\267A|\003J\270f\275\327\017\333Azm\246\235\342\"e\210\201\023\024D\242U\252S\020\215\316\247\225\217=\265\3432L\2279\230=\330_\213\231\232\307e\332\353\376\355\363\214\270#\317n\275\366!?\322v\310T\275PC\320IK\2120\342\337\275+;\332l\342\306\342\224/\3205\265\372{\004\0161n\243\020\013\022\t\004\261P\321\377O\233\375R\376K?k\253\373\341?\225\014A\213\204\263\010\324e\201h\300h\317\234\350\357\034\025\006\034\206a\265\367h2\240\013XV\315\214\"*\256&\306\020\267p+\203\354\322\315:\330\367:\034\236T\312\247\\\370X\347\312\244in\030E\373%\035\335iOn1\000w\272P\201\021ADX\003\005\332fP\314\215\367\341}1\r\010\212\233\003&n\204p\233\244""\020%\2456?\232\n\246\032\340\360$ \323\376U\261\242)B.\251\302\313|W\336\213\225\303[\266\237\212\350\246\261\314\207\352\004\033\326\332\203\376+v\027=\332\211s\354\271\031\372\212\201\316\017\217\310\341n\270\371\352E\321q\277;\277&=\260\257\244\3560;\203\242:!F\"\335\330\332\3715\373\037\371\221\361\302\021\203\206)\201%D\377a\215\342\200\207$\023o\237'\030\364\344\264\313\367}!\177\005\227\014\245\367\024\256\221\360\177nN\302,\262e\331[Sl\203nkr\0038\006\257u\265\223\314\034\374\256;\276\300=\336\025\201\250\367\260]\326;\232(\034*3K\257\271\266\227\216\025\2039\366\367U\317]\315\330H\343<1\220\300\342\037\177W{x\342S\302\246\267(\376G\301\331\354$\004\033]~\203ta\305\331sg\212&\376\372\375'>\344\375\355\277\356\276\355\343\344\310\032\021m\357xWp\361\254\364\203W\342\260\300\316\302\305\326\366\023y\273\336\277\221)\240o\330\332T\362\303\337\223cq;#\273\227u\323\177\220\025o\236o\375\342n\3654\001\361r\362\233\240E\305[g/\301\221{G\007\004\261\335\010N\347o\263\262\343\303E\272h8]R\347e\226\374|\213\310\274\212]S\227k\2544j\353x\203\224c.\214.\243\030\226\322\356\267\354\026\356}\355\273\003\210]\362Wq\313M{z\354\270]u\321\354\220j\247\202\356\273n\257d\361\014\342\027\364c\3168\340#\326\343\331f\036\222\232<>\377W\252\272\n\275OO\013(\2737:\312\247\001\374T\330\364V\345\340\320\030p}z-\363Y\265\370\032:z/\035f\300\277m\226r8\\\276\366~\246\201\307\300\273\001\323S\247\335\376\007\303@\364\247d3\354\263\317f\267\325\364\332o$\357}\236\275\253,\265\315\241\235\256\026\035t\334S\243\347\230.Z\247WQf\246g\026'\203@\337\374p\364\314\\}\016\374\020h\343c\263z\277of\371\330Y\273{\3765\310\251\241\177k?\273\365@n\244\270\241\233\265~\024\224P\363\240x[\314\0031\203&\271i\264\312fR\247\322\nf!\335\230f!Cg\264.\316\316\027\330\234:~\242:\262\346\323_G\2415\374\022\3177\236\360\225\310yg\340y\r\331\034\027\274x\032\272\336{|678;\r\2311\274\\C\255\327I\001\310\212\321\212i\025\366B\251p\356\035I6p\215\362e\304\205rt\225Z\000\210\240\203\313\303\321r2H\206U@\330\203\026x""\241uY\304_\016\263$=\246\006bK+\255j\261E\026n\321\037\202\n\005\226\3661e\221C\234*\351V\217W\255\266c\"\276#/rI\002\266@\212\210\274\307\327~@\250\305\300SJ\201%\250\006\244\275\261b\367k\272\325u\034\\\035\332\276\346\271\304\331\337a\250\325+\220\261\317\315\017s\340\343\307:\"4\352\231p\346\337T\215n\211\233F\260;b\324\257\247\371}\021\254\313\341\254c_'\232\327\213\306\0220g\213\201\030\337\026\366\220U\362\017\205d\331\022\264\340\n<\306)\370\204\361\r\016\353\305S\006ly\313\245\316\321d\361M\3270\361\261\341\3024\n+\200^\2545f,\\\265\250S\322\251z J{?hmg\355e\256Q\035K\332Z\245Hn\3136\031 \002T\2642?U\007\246\376\r\317\312\343\312O\275\301\304\260W\376.\344\212p\241 \332\347\215>";
    PyObject *data = __Pyx_DecompressString(cstring, 8101, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (8433 bytes) */
const char* const cstring = "x\332\305\\\313\177\323\326\266N\332\320\006H\200\360~\025\224\360H\014\216!@\201\006\2226\274Zz\017\217@\332\236{8TUd%Q\261%G\222\223\270\257\3030C\017=\364\320C\017=\314\220\241\206\032\346O\310\237p\277\265\366\326\3136\001\332\236\337M[[\332\332{\355\265\327\343[k\257-7\267K\301\337\214\362\334.;\272\241Xv\336PV\227L}I\251\230F!\357*\363\232\247/\031\256\262\340\330EES\356i\236\346\032\236\342\352\232\225\333\305\203\347\226LW\301\277\336\222\241\330%\317\264-E/h.\206\330\0167\216P\347\021A{A\323=\333\251$\207r;\276u\255\244\315\027@cA\321J\245B\305\264\026\225R\331]\312\333\253\226Rr\354\237\r\235\210\273\n\310.\230\005\317p\\&\342\331<\013\232\014\3051\264<\332\345\022\034#_\306\242\350\251V\264\313\226G\264\363X\001\2324O\261\014\003\013\364l\2462/\006+c\346\202\342\226K%\333\361\214\2742_\211ic9E\315\313\344\224;e\214\265=CP\361h\ry\333\240\205xLJ\007\223\236S\326=\005R\260uS#J\202c\342].\205\327M\323+%\303!\332r&K+0\0251\200\204\020\217\301\362s\3123\r\035\235\254R\261\313JQ\2530\267\005\301\247\253\025\r9\220i\030k%\307p]RI\212H(3R\214\220?/\205(j\005\327\226$\333\244\333\205}\251\306\377%S!iI[Y5\013\005\022\250V^,\032\026\255~\325\364\226`B\032\337_\342~\212i\345M\235z/\031\026\2231\213\245\202\251\233\236j;y^\371\324\234S6\210\003\303b\313p=a \3621\033\230K\243\014\345\376\232\241?-h\226+Yz\2529\220Ed#\343\321\037\337\346\245\025O*\245\212\3468\366jN\266\344\244}s/a\241`\200g\025&\005\363u\241V\226\t[\222\313\216\223\343\001\027.\274Z\325\234E\027t\2614/+\335A*\224\376\236\223\300E\253\233S\236\033\206\362\0235Y\206\223#\007S%\033?\361\322J6TGS\203f\231\004\347\212i\034c\271l:\206\352\342\333\260t#\257\332e\257T\246\345\314\333v!\253\344\215\005\255\\\360\224\007P\246\021\315}GjGs\014\341\334\320\213 \341\231Z\241P\311*\005\363\025\204\014\311\026\214qo\211})\337]3\357\230\352)\254\316pV\214h`\2543\351\201b%\022|t\2738\017\273g\313$\357\307\nu\014\020\366\244hV^\230\2404\037\005\344t6tH\354\275\324-\310\251\202\334\244\362\214oY\034)='g\025\374ESN*\017""\344e4\"l \216\275\256\243g\244\332\224\321\370\312\261mO-i\216g\322jG\225%\330\222ia\244C>\345UJ\2062\006\257\305\r\264s?r\337\254\262h{J\254\312\262Y\310CN\2560'\303\021\262\323\0265\023\320\023\031'\031\364\256h\020\231\266\302x\353)\005\233t\013\365\024\215<\341S\241\222S\036b(T\236\025\210\0067'\360\204\271(\322B\263\021%\341\n`\323v)2\224\035\002\244\230\017\027K\310-\346x\022R9\214K\370\n\326\252ED\330\253\262\320=p\231z\301\013\335L\202]r\016Z\310$\364\2724\371\0267\241gv\236\275%d\303\264\004P\023V\306\324\332\014\244\213\221\010\344.\224\213\026\371o\301tY\263\000\362\330\310\037\333Vl\343\241\325\204c\010\310\0054\346D\\#\335\020\010F\264DO\305\002#Q\330\t\377`\003\2052px\214\035\205m>_&\337\201rb@-I\277\312g\262\004\305\032\303\014!\214SIQc\270\375\3252VU1\247JsN&\302\301\357\312\212V(\033\"F\027m \202\226_\321\010KRt\022Q7!\313p\345\351uq\\\216gp96\225]\241D\027\026\r\220A\030\241\244\"E\351'U8\246\212x`\254\375\244\214Q\177\276\016=K\370-\255\311\264RH\220\311\266S\n\237\274\235X\344\322\tz\322\234:\311!\215!R\021Y\020D\264b3\213\031\203\252\251\037\246I0F\032\354`\016Y\004)B\262E\227!W\"\212\210<C(\326pu\307,\205\220\210>)ja\377p\276.\332\t\265\022\331\016\222\021\270<gS\260U\031\350\\65\306\037\267d[\354\257$\216\024\271p\0326rm\3056\363\241o\223\377\226*|\301&K\346\t=\233\277\020\035\311A\212\024\347\031\314\022\301\020']\034\314\362\221\377\n\006y\001E\0045|/\001\325r)*w*\221O\022\270H!j+\232Y\340X\035\256\235B\235\264a#O\231\223\t\300JQ\202\217\032k\272!\004\215\324O\263*1\240/\030\016\307\327\264\347\206\271\036\006\302\001\332\2748iO\243.\240s\311(j1\3632\215\232LA\373[\341\205\263\005\026\226cxe\007\226`\311D\217\300\022\016\006\363#A\307\tZZL\017\027\342\034\202\372`\312<#Jl\024\310\257\023F\001\367-\330\246\327anQ\300J\242+\031\252\211\354\316A\202C@\2541\306/\000\317\363IAt\261\333\254\302\361\001\230\214\354\303\243\264\316\203$M\035)\321\023\262\201U\250)L\361\231\216\010W)J\211 \016u\314\033\013v\230\326H\211\024cY\010|q\315_\020M\210""\345X\344\023W'\324\3137\256t8OQ[3\213\345\"\311YD(\221kr\014\312\247B\275\001\246!g\371(E(\335\215\215\321^A\256_\260W\211\307\242\001\340euZ\"\344\312`&\342F\212\222\016+\307\274\320P\274\2451)\367\375\305h_%em\332\022\355d\332\227z\275c\225V\2718O\201{!\342\221g\300XA\001Z\324\030\223dD+\232\213K\274\365QVm\347U\032\"\010\265\n\205\344N\211\004c\351 \347\n\215P\352!&d\3533\305\263\364B\237\315<B\314\320\026\201\255\310g!yJshG\202D\322\201\360\224\207O\224\262g\002`d\200o\207\250\267\257\377\3326\313'\256\333\026\377\377\302<Y\221*\267\007\211\234\223p\340\211h\335\006-d\017\021k\027L\235\301Z\270\256^.h\302|\031\246\243\030H\371fV\244sm\366f\021\354Z\264\024\303[5`\241ys\201\341Pl\375\335(pQ\020\213r\315p<\302\276*6\020n\307N\201\366t\355(%\366w\234zb\252\320\371\300:\331=\322\214b\004Xe\216a\224\310\025M\2137\350m\341%\251\3268 \334}\372\035\0059\303\215y\3245X\274\032\341\326\007\261\031\215\242\034\007\\1\255<\357d\005\022\260\321\330\244\n4\227Km\260P2\270$\300\202\214\031\022x\240\226\300\006\270y\304wOS<u\250\374\001eo\002F )[\327\244\215 \220\205q\225\321\211\\V\232\005\261_\246\264\275\035\343\303Ih\376D:\361\214#OG\326\034\335\013\340\243\220&3\364x\350\3755\215\366\346\235\031w\3240==M\316a;^\270\021\247=BIKu\020\333\357)4\347\370r\354\327\321\212\2419\243\223\312\213+\227\257\\\316*\370\274\302\237\023\361\365\304\027\242\345e\234\323\345r9\245\363o\324R\013\306\242\313\3240$\253\\\343\177?\317*\023\227/\277{\264f\231E\255@\243G\036\0244\330\344\242=\222UF\236\322b<\272\272g/\322\3277\266\343\032#\357\"\227\370\033\271\343\230\236'\212\036\216K$\356\322F\275d\344\215\221\227\277g\222\022\332F\234\271\222\214\261$\326\345T\307\322rn\025S\300QY\250r;6\"}Y\225z\r\t\214dvm7MXP\3014\211\364\236:\206O\246\360 \3546\366>\263<7\n\264\365\240\375\243\342\226\347\211\206\304\034\231\335M\356\3526QN\222\034\223\275\246^\214\220\265\220\000\205\246G^fr\236-W\035\3131\\\311\034\265G\2554\224\343\310\3658|\0102\355\255)\273\026\303^\010\373d\223d\353\224W\260M6\315""\227\035$1\"{%{\r\377|\236%\363{\231\330\300\312\255\030\344\341\262d\242\264\324\205?\263\230\254\304\366\353=\205\363k\207AJ)\251e,od\222\224\306{\266\261Pz\231\234\216\315\316\330\010=\2779\222I[\364\357\037 \332\304<\223\nS\353.\313T\277m\004\364 \252\227rr\214\240V0\"0~\2078D\2569\025/\226M&\243L\023\206\\\376\257\330\213\000\216I*0\200\277w\232Q\332\202\336j<$\031!\227\366y^\274\210@I`R\010II\\\211\207\335\205`(h\300\353\242l\301M\024/9\341\033\r{qh\251pA\212\366;\"\020R\316c\212\002P2[\177\306%\372\367\035\211\t\347\271\334\314e^b#\334\360\314p\270xZ\271\253\225\3342T\r\007\361l\330u\274\004\333B\266\355\211\024\226v]\211j8tA\311\221W.\211\003\207\261\274I\0058\004\322\254\022n\3233\302\257v%s\013\275\354p\016\024m\210\330\037\211u\343CkM\304M\227\002t\2741|\377\030\314\313x\301\245*|\274|\237\010\034\303\254\324\000\255N\354VE\355Y\363\226\\Q\020\036\271t\345\362\345/.}[\266\214\221\311]\037\026\273\337;L\264u\014\367\376DQO\207-H^\004\223\244\016\306\220\034\010\013\032{1\026\002>\332\240\347\211\353c\231\314\007\004^\376\033\033)\332\226\267$\210\010\027\005\225\227\231L\007/9\261\331\031\353\230`\254\244\267\241\311\324\2242q\363\372\225\214r>\371PL\304OG\276\325\254\221L\212R|76J\203/\241\313hV\031\035\215\037\334\276\353\256\000\374\214\007\314\0101\205\354[\272\351\324\2754\322)c\005\244\315\312\225/>\317\334\017\253\314]\274\223kP\360\022\330px$\027\356\020MQ%\016c\361\242\271B\333W\354#\270\246\021R\234\023\331D\202p6*\027\362\263K\251G\230\256\223\207\367\233)\244\312\370\3145\310h[>\027\215\342N:\004M\365q\014\352\030\037\326R\005\254\311\3508*\252\356qg+Q\266\021;\336\260\357h\242\022+J\253bltH \212\010\305\262\353\211\232\260e[\343\226\261\210\204\235NI,f\201\322\373[<\014)\373O2\037W\273n\016\177\242\252#\257-K\233\265$\224\352\002\366\242m$\010\323F,\274\377+\244St<\243\310\247\027\302\355v\335\376\326\265\255\330\014\247\037\321R\251\346\250\030&\327\365\004\242\260\320\250\233H\357l@\026m\226eqR\014b\3647\302\210\000\240\216\017TMk\\\356wB(""\021\347\322H}\212%\257\302\332|'\221\320\027\302\241\241\231?\226\234\262c\252\242\330gq\331G\204&\2067\342\363V(\030\323ZH\367'\025>\216\216\206\357V\274%\n6@;\354b\347\351x\304(T8\344\353\036\327\2201\373\323\373O\307\257\335\274\306\033s\307\240X\347R\276\313G\350\006\357\263\347\313\210_\246\260}Qm\242\203Z:\275\346C\007\222qb\000o\241I2\3444\243\314'o\013U\014\007\214\221\245R\250#\273\303h>\267\313=\241\272\"XW\356P\365\356~\242\210\317'\t\232<\024LFP\252fE\347\344O\023P,\0011D\232\317o\336\310 ~9\246\261\302G\266Q)\231\017\372Dd\306B\342\203e\332\337K\335\312\303*\332\332\256r\375\026\252_1\022\345N\232\256[%\007L\226\013\236\230\317.\n\323SmGu\245\321E\216\210M\262V\010\317\270c*Qhqs\337Y\257,\252\216\272\206pd\303\322mJM&\225\267=\371\001\273\252\260\214\316\025vZC\305H\2440F^\276\033\201\005&\nf\271LV\231z9\375\245\226\2075\301\210\244\221%^'\020\236\023\326\376\371\205\014Z\033k\311.G\035*\000\316\342{\214~\027\020DR\022~\221<n\n#\004\210\323\261\021\t\215\302Pg\301\352\357\235\203A\246s\222\274\351\222\003\213\372\014\227\345\241\000>%T\347\215%m\305L\250\234\314\034\224F\r$\032\016A\274.\240\372\035g\2611\362\204qI~\347LW\326\205\n\306\002p\274L\265)m->\344U\343\025\211\032t\310\311\345\2542>\221\r\221\177\024\234)\243T \026\333r\230\253\271\010\370\241\007\210I@\020\244\224jX\363\037\215mt\352\005\033\301\224\314\235.\205\247\243\271Re\355v{z\t\017X\310\351\241\370\263\342\326]I7\254:Z\251d\344C\224\243\002\227\010*\002q4d\335\014l25\347|\321\324_\301\341\027\273\3217K\372\177\225\376_%'e#\231\265TY\210K5\377\255s\374Ub\362%*A\214\021\217=^M\265\377\255\223\224-2\344\377\036\375\277L\214\001\364o\242%\361\345\357\241\306\311\005\205\234?K \314\343\376\354\370\3446\351\357Y\222\314\237\376\036b\177a\374\230\347\030\2113pF\354\251\262\2670~s\227xC%:\251e\324T\",\227)\353\214\343h\025.#\314a\344}\212\007\355\371\317\2352\235z\310\222Er\233\225\272\311\251\2528\227S\325t;\247\027n\272\255\250\2752T\t\361B\265\3629\345\r\306\223\2676\305\223\350,\221h\256""\266N\224r \343Kw\353\014\231\335[\333V\322\245\203X\222z\357\376\203\231\357\3761\247\336\231\231\273\373\215\372\354\376\314\275\231o\360\321\326\376\374\341\277\356GM\017\236\315|\375\350\376\343\271\270\267\334\234\312\257\007\002\020\322w\235\253\356x\336\261\340\266\036\013\246e\272Km\215\010\336d\014\335[Ua n\270y~\033\017\333L\236S\027\2158\347\211)I\337\tU\037\266\363\366P\245\302e\330\"\022\334\360\256+1:\246\014\257\177\266M+y\255j\256\275\02068F\251\240\201}\261\254\266\222@t\213L^\235\017\305\237\363`\246\321\265\255\312Mu\242\2057\334\367\242\324\206\\\350^XDK\356\007\2726\346\220\261\351\224\353<0\370m\326\330?\272]u* \365\254C\007\211\247R\243\355\376\027\312r[\277\344\207\311\216\362:\341$\251f\273dXq\376\035\232VG\203\260\265\267\265w_\353[zv]y\252o\033\257\351g\374.\035o\216\342g\222\370\223X\004\335\332\267\343\262\243gW.\223\250\365n\250{\037\234{ \353\266I;\353\326\026\333^\250\333N\230\333\026\032\243\t\273v\352\344\253\303l\272<y\373\250\030\032\242&r\374\350F\272qtO\216\033\337D\236\233lb\327U\325o\036~\037\243\363\323\231gs\017\347\036>y\214vs%%\260\366\373\204Mu<\ne\373\320\022\007\330\322\324\332n;E\321\331\241C\"\017Kz\354\256\251\233\004C\351v\021\254\322m\235~.\237'\355\253KS\027\236\273v\352\340;]\030K\337%8o{ X\177\313~\367-\315\355\324\336\032\276\377\307\250|OE\312\244\352\272\265%\010>q\022B\224onuo\220\263&\232\222\022\n\233;yKN\234\362a\255#|t`\245\332\235\353P\005mO;T\324\245~\225j\0225u\365ie\r\377Q\314S\037\033k\3363c!U\265\216.\037\312\234\277KS'o\335;u\260\330Q\037WIt\217\355|(\330\355oA\022i\220\247\252j\347\2036\206\272\364\350\340\246\263\017\235\346\333\361\324@\244\360\215\355\216\t\342\007\035t\303G1\350\245\336\373\226X\326\355]\360T\333B\302\272\250\221\0003\274\346\362S\033!\302\314\350\332\356xj\253\342wE\211\006\206\3209\361\261\270h\344\023\352\351h\010\325\372\326\007\235\"\332\256k\207\320\276\243\315\271\004\316\344\265\364\222.M\235\023v\357\264\355T\t\357#\007\367D\362\223\270\354\234%\375\260\203\272\346,""\322\317g4\332\227q\331\212\232\350KW]\354\365\264\"\356]\265T\321\\\335\340W\2255\267b\351\246\rsq\354\262gZ\206;\017\316\324\274\351\3207\005~\025\t\t\222_\317`\235\312\027\315!\313\266\227%\3437D\347y\307G%w(|\276\242\253\211\352\276\256\306\305\026\276\006!=2\266\370\n\035\345\217\233\242J\225\316y\226\256\212\312\264\236*\202\352\341\256@\227\031:\276\271J\233~EM_\002O\216\0019q\251?\372\222\337\330\"\230T\004\302-\004Ao\255{\016\222\376yM\177\245\027l\327\320\013\210\314\032\330\207>^\031\025\334\344\r\035\237\205\202|\303_\236z\251Q\305\330v\324\350X\\M\226\021\302BP\252kxl\376\356\236KH\032\272\366j;\272\242W\313c \240\027.=\326\255\356\256\310sx\251\203<\211'|\245(\374\226\257\024\305\367\313\262\022\275mA\272\255\314\252r\361V\025_Q\035\3274\334H0a\302\203.\266\256\252\206a\225\213|\320#\"-W\231\2155\376q\007t\262\242\025\314\274\260\242\356ej>a\211\352\017\211\237S,\010\031a\352\005\261eJ\330%\321\243\377\302E\3605\0313_\254\230\256\211\221\241~\222\365\302\3502\024\022\347EB\250\341\321L(@\261\215V\021\035\347\261\004Q\224\367L>Z\022\0213\224g\347\253\270]%\0359K\022\331\223\210\236B\362x\253\302W\002\016\350r\276\342\031p\202\205\262\005\351\32369\265UN\335\360#\333\021^,x\346\246\320R\344\tZ\252\315\255\024\347\355\202l\221\365|\362\036\236K\240\227JK$\2336;~&'Q\200\217\t\223\307\0002\026\313\315i[\325\201\312\345&\271\241\3044\272\t\217(\351\232\244\240\322\233\031\344\356\362\021Y\206\374\246\335\177T\001\340\013\252\213\375\214|\220\370\026?P\244\223\n\325\005\322\231k\005\333~U.\251\260x\364TS\233\343\316L\231\3165h\227+,g\333S\216\324C\356JN\254\226\014\201\024\251\206E\254\264T\324*\363\211\271\343\227aUF@\tv!\030\026\301mz<\236\331\3712\355kp\345\330*\210\220\267\250\354\"\311\317<\277.\303\216\203\006cU|\010s\247+\271V8\237g\301\005\255r\241\000\200*\024\010I\341\334<\255m\221\030\350?#/\373\343\313%\343j30\272\025/\267\240'\371-\224*~\256\311z\351r\336S\322J\232Jo<\002\277M\262;]\032#g\241\251\327;b\351\207q/n\211\261#\t\265\335`7V\023\231""\026;Y\307\211\251*\177\244\254\262E\245n\310\316JK\025\327\324\265\202\264\341\222\ru\224h)\216\301\027\374\2535\341\026%8\255\035\233\224<\240\n\317\251T\371\346Ot/\301\240\375\236\344\332\321\026\312I\266\027\314\371\3602\022g\330@\357\341\2033$\364\272V2\311f\370z\311\320_\271\3201\337\211X-\256\245\253\323%\251M\\\225-.E\033\311\274F<Y\221[lU\245( l\217\3400\371\006\205\232\272)UD\216\231\374\255j\234`u&\351a\203\261F\227\013*\"K\272\314G/\200\033\300\366\2744\355\267\375j\030\253\024\013u\350\327\035\352|E|K\231\212\033B\016qe[\342[\200G\372\327\254.\341{\001\366\231\310\260S\220\337~M\205\320\266\202\250\304@\361)O\326\325\360d=2F\341(dX`\002Fn\024\026\220\356\345y\023\262mx\347\244SbAr\313\202\313p\\\234\226\252]RT\2026|\026l\217h\211\222)\177qP\340+\221\273\321%\261,nJ!\270\227\322\200\312\304\371\367O\272\370\365\217*^63\027*\"\332E\357u\250\362\2709\262d\267\014/\244\215\213\252\022\t\225~pa\257\306\273\227\370*w\233~\032Pp\247sQ\260\210\2664\341V\306\2639\220zv\001\035`\035d\344l\350$+>\375+\227`\022F\3311\351\307\035\241\\\022?\364\200\001\362\213O\342\207\245\234tPB\357\246\326\373\213YR\330\001''\037P\37629\371\310p\026\303]\2442\366\264\362D\234\363\\\310\364\204\035\343_B(\027\306\344\273\014\302\313\354\371\237\325\033\322\243\325\253pw5\3317\323\023S\3038\314\345.i\224\320\224<\347vH\234\317\200\246\345\377\263A9\377^c\304\241\320\007\016J\354\345>p\344sv\252\017\036D\346\366\201\203x?\233\034C/\246\215\205\024\241\357\262\033?{\227DS\272|\247(\337\253w\264\250\367\352\035\256f\333\316|O\311#\031\340m\t\360\261Q\335\224\277\313v\325\2330/\321\366\234s\317\037\034\255\364\000\343\246\225\364\024Y%=\335\266\346\372\230\337\377\243\260\001\255$i\320o\2212=\252\010\366\"\323/\222\243\204~\324#\262\245\2625o\257\251\211\\\251'$O\307\252*o\244\323Mb{\333\326FF\231n\022@\336\336F\322O\2671v\364p\330\344\020Yv\243\347e\253\013\017\262\261\215\013\331\3326\201l\025Sp.*\262~n%\225\365,2\226\223\0109\343\222z\227\031\304\344d|\216\333\203\275py\233\347\3126""\270r3LI\324D\377\013\374\246\365v\252\225\357R\303\006\324yl\003\344\3342\252\022\372E\257b\245\024\237\246Z\022\020\232d&\314ud\252\316;=A\347B4\210\377\237#<\022\263\267\367{\335\033\364\355\366w+\365\235\215\375\215\t\277\357L}b\353|\317\316\201\365\033\325\321\332P0p\324?:\336\230mh\301\320\376`\337\261\332\301\332?\375s\327\233Zsy3j\250\377\320\230\331\354?\\5j\023\265\307\215\341\306\304\353\336\255+=;O\372'.5V\233\332\326'=;v\257\017\007}\375\353\273\253\323\365!\177d\2625\334\272\2761\024\364\357]_\255.\324\356\327\017\324\357\326\227\305\355b\355\273\372\231\372\363Fo\320\277\307\3373\\\037\252\2176\2164?m\342\361\356\365\211\365\207\325Y\214\370\272~\275q\250\261\324\324[\207[\313\340\177]L\271c\217?x\246~\233&\r\372\006\327\177\254M\022kt\371\357\332\221zo\375t\263\2679\204[\177\360\263\332\277A\265\227\257O\327\226\273~\217\324\207\371\033\022I}\217\200\243\241\006\236}\352\177z\252\246\327\261\216!\177\350bc\"\330\251\324?F\247\376\241*\0047\030\337\362\323\315\376=\353?\327z\203\301=\370w\223\331\233\330\354\373\364\365\357\325\257k\350t\270Z\250g@\343\360\371:Il\347~\177h\264\376\233\177\365\361\033\r\264\374\301K\215\345\315\276}\325>\356\275sW\320\177\320?8Z_\201j^\265\206\374\276\253\376\325\273\033\023\301\261\254\237\375j\24378v|\353q/i\361VU'-\036\253\261\264\275\352\225\352\217`i\340Hu\245\366}\375\313\3460\024\\\033\254\277\014/~lN\320E/\304\271\253g\307'X\343\353\337\252W\253Z\320\27738p0\330\273/\0308^\033\2266s\242\366E\375N]{=\363z&\270{/87\325\232\r\316\235\017.\\\014\306s\301W3\301\350\014t<\236\333Z\353\355\031\274\334\370\265\225{\323\273\325\217\225U\217\324>\256\335\254C\"\373\253\027\375\317r\r\315\277tocfc6\270t\243\271\332\312o\014\007\375`\330?~\321\277x\2535\021\234\023t\202\363w\360\344\374hp\231G\346\240\320#\215\276\306\235\306bs6\220\346G\254\214\234\t.]\016N+\301\321c\270\336\372\206\344\340\357\316\300`th\177\200\324;x\261q\025&=\260\337\337\177\256>+\004>\260\216\245\037\362\017e\032C\233\2442\251\346M2;<\250\376\313?}""\2559\323\234\345\207\347\374sd\304`d\244~\016\246\373Y\206M\002J\037<\355\237\236ni\301\340\241\352\354\353\031\020\306\\xp\206\226\253\370\312\325\346D\363a\013D\206\353'\033s\315!\377\n)\270\377x-[\3177\206\375\213P\336f\377\300\3727\325\0075\214Rx\215\2376<h\327\277\373\322\177\371#H\356c\343\030\251\217\221\253\005lU{\352Z\335k\334\364\257~\275\301n\264\0141\234\307T\301\251K,\332\2551Z\337\227\2653\265\331`\340\263\332,Mq\277z\264v\024\306\013F\377\211f|\375\233\356\216\325N\326qG\0162\2649@&3Y\233\255\0310\232}\207\253&dw\020L\371\303\3677f7\026\336\314\004\007a\016\265k\265\345z/\311\360p\365\005\231|\375a\3439\271\032\311\356\352\272\006\257\326k\007j34\371\376\352\205\332L\260o\210\014\341Pu\206\032H\221\207\353\2775'[\263\220\333\300\276\352\307\325\233\260\254\231:\330\334\353\357%\031\234h|\323\234\t\206\001DX\330gP\003i\370(\\\342\317i\267M\243\301\300I0\367\003\315X_\204R\016\001>\006\331\207#n\241\306\317d\237\347\260\271\373\315\241\256f0\002[n\374\207V\001C8\356\037\317\002}\204!\010\256\231\345\257z\377<;\0318\377\373\263C\002k\330\360\312\210\035\210\021\274\364\237\200\312V\375\363\350\014T%G\276Vs\201\272\263D\370\000K\r\263l\366\237\256\225\211\213\327\322~\256\255\377R\033\252e\352W\360x\340pu\276\366IM\203\270\t\211\306\032\275X\t\240\r\353\230\203Y\035\203m^o\022\346\370{\t\303sd\016\257g6O~F\216\211\317\341\221\340\354\271\340\306\315\340\324iq\275\365\013\304\262\017\346v\023K\0348H\246q\240\312H\265\314\002\021\252\035 P&\200\n\006N\324\004T\005;\367\300\304\310\342\205\265\364\325g\344\365\030D3\023\214A\t\230\031\263\2359Ksf.\004\331\361\340\313\257\202\363\004\224\331\361\255\3370\361q\377\030\351\nr\032:V;\006\317?\332<\321\232\t\206\300{0t\326?{\2635\260\201[8\360\345\346\000=\030\255/\307\360\205\200\263\330\232\243\200\266\r,\345\010\237Gocp\007\007\217?\"\361N\"\264-\325\346i\001\001\034o\231\034\356gP\203\033\302\204\202A\310\204=5\361,8x\210\036>\253z\376\211\361\306\277[CP(<x\210\260c/\273\335P\212\212\354\370\022FrscbS\030""\024d{\347npR`\r\302\356\260?|\243\271\334\372\004f\334\005\206\037\275\231\r2\360~\240\360\266\313\205^\241i`1>!\365\321\261`\362\226\324\372\350\330\326\203\217H\331\253U\253\316B\027\252\376\000\245\223\206\007\326\037\2619N\340\006a\007Sa\022\004\237\251i9\341\205\213[O\223F\365\276\366\004>`\362\n\301\331,\211\340`\355\307\306\265\3062\322\005\270\352\227\265\321\372!`\365\305\346\017P%\002\353\351\306G\024%\310\207~\201\331\0145\317\302_\373\217\326v\0006\363\240\336/3(\226\217\200f$\010\007\253\263\" \337 ]\355\253\356D\202\362q}\2621K7\275\374\021\272\035\331\005\001/\273\334N(\022\220\237\257\216T\037\325\031\022\262\376\251K\215_Z'6\220\203\355\215\374 \3238\350\217O\221Q\202\314\376\236={C\317<N1c\357\372\037\340\016\221{\353x\342\321Q\002\243\264\303\002\020\342\347\247\005\246\357\257\016\007\034?N\021\354\223X\261\006\377\004\371A\030|\266N&\206\035BpZnG\202\255\203=Hb\006\210\026\326:\310P\366]\343Rk\210n\367\324\026\201}\006\022I\212v\203\247j\377\252/\013\020\277\266\276V]\255i4\351\225\352\313\372p\375\032\371\341n\264\377\001\022w\352\257\232\007\232w\221+b\352\037\000\220s\365S\360\315\371\326\016` \245\253\247k^}\272y\244\365Q\353\",\030\331\353\251\372rc\240y\017\rHN\336\014\311\234\226Z\373\032\217[\243\033\3737>\177\203\200\014\214\204\241P.G\0060\034\256\022k\030\252~\202\354h\037 \220\302\355>\021\364\217S\222s\020\374\235\007,\036\341\244\023ft\010h\371\007\245\322\254\242\365\377\300:2dW\341\255A\226,\345\022\311@\270\336\300>\177\037BG0\2000\200>\003=;\217p\242<LR9Y\273Q?+d\274{}\252\326W\373\266\256\371\243_\264Nb\211\310\326\316\3264\377\364\245\306o\255\033\033\214\nnu\270:\305\211i\204!\354\025\265\001\377\354\215\346\257\033\303\000\2066\243\367w\237D\312\3759d\362DP\341\356\365'\315+\260\351Az6\021\266\205FH\353\330'\255\021pE\366\014\211p\356\031\332w\312\322\305\262G\352\027\374\354\227\255e\300b\377\200?@I\310\201\306L(\356i\022+\031]_\375\021\224\330\033\034\376\214\254\230d\260o\275R\353\255\035\256\375\336x\330\234m.\264f""\336NRm\334\215\355\024\232\272\3208\325d\006\373)\215\362\t\241[\024\010\001\003\237\203\346A\232\"`\023[\336\244D\374\024\364\226k\356\210\2749e\311\376>\245\376)\254g\207?\2169\223\246=\034\371\341\221\252'7J\327\032k\315\337H\334c\215\0350\214\005\030bokHz0\331\352Dp\372\014\343[?\017\nD\252p\202\023.\312\263\356!7\\\243\255\321\t\377\304D\223\341\340\254\177x\334\037G\006\272\t\014\002Z\300\006\373H\000\177\274\231\215T\261\023\026\376\237\246\366g\351\022lMA\t\017\033?\266\2109 \2742L\321\025\237\000\342\261Lp\3536\3011_o}\365Q;\004\177Pp\207\\1\3056\364\177\373\323y\203 \315\313\231\256\037\244<GR\355\032JV\376\364<\034OHJ\"&vF\303\037?\026\321\260H\3561\370\201\201\220\366\003\273(\235\026>p\260\366\222l\215\210o\263\030\221l\375\371\370\313\213\362\373\356n|\351?{N\033<`\363\027\325\2734\214\306\302\236\222w\274\361\364\017Q\222x\270\341\001'37[\273\200#\231k\315\177l\364\322nr\327\372\305\352\254\337\2078\031\\\277\001Uo\3458\255\027\033h\332<\005\375\007\374\003g\341I\3377n\223a\"w\036'\363#s\376\264\372;\036\314\361\016\354\334\027\255#p\365s\234\332\036\251\2269\010\014\325\261e\205\210v\354Y\237\253\236\250\335\203\213z\010\203}\003\353_W'\260\323\312\3265\332\351\256\254\377P\275O\016\037\210\030\007\3367\331A\250\214p\037\221\345\036\222\242E\240*\372\212\200\226m\334\003\272\037i\355\336\270\361fx3\3352\261\316+\243\215\341\371f\257\337\207\370\210\260\3101\354\017\346\351B\343\353\346\004\270\032<\220\330\023\221\205}I\241\306\357\313\370\031\270\333V\026\215\376\336\363>%\213\033\274[\230\254>\257q\334\235\246\r\033\341\356n\006\347o\233:\305\317\003p\316\336\315p\357\362\360\315\020X\2133\363\243,&b\225\"\3324\362\025\310f\263\017z\246\334vw\353\326\306+\177\366Y\320w\240z\253\266\304Q\205k\000\224\246\364S\032c\265\036\277\031\346\222\213\337\207$x\353l\317\340Y\377\014m\\\276\367o\315b(\317ER\273\021\356P\231\321z<)bv#\2560\354\240\t<\340O\377N\3047\177\210l`\340\024a.\005E\215\2577\331\030e\235\007\303\216\325\250\002\261~\233g\031\256O5{eI""\342t\255B\351\330\377\001\017\305\310O";
    PyObject *data = __Pyx_DecompressString(cstring, 8433, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (23239 bytes) */
const char* const bytes = ".\n    A Source node which yields batches from a Dataset scan.\n\n    This is the option class for the \"scan\" node factory.\n\n    This node is capable of applying pushdown projections or filters\n    to the file readers which reduce the amount of data that needs to\n    be read (if supported by the file format). But note that this does not\n    construct associated filter or project nodes to perform the final\n    filtering or projection. Rather, you may supply the same filter\n    expression or projection to the scan node that you also supply\n    to the filter or project node.\n\n    Yielded batches will be augmented with fragment/batch indices when\n    implicit_ordering=True to enable stable ordering for simple ExecPlans.\n\n    Parameters\n    ----------\n    dataset : pyarrow.dataset.Dataset\n        The table which acts as the data source.\n    **kwargs : dict, optional\n        Scan options. See `Scanner.from_dataset` for possible arguments.\n    require_sequenced_output : bool, default False\n        Batches are yielded sequentially, like single-threaded\n    implicit_ordering : bool, default False\n        Preserve implicit ordering of data.\n    \n    A combination of a record batch and the fragment it came from.\n\n    Parameters\n    ----------\n    record_batch : RecordBatch\n        The record batch.\n    fragment : Fragment\n        Fragment of the record batch.\n    Argument 'Argument 'root_partition' has incorrect type (expected Expression, got \n        Build a scan operation against the dataset.\n\n        Data is not loaded immediately. Instead, this produces a Scanner,\n        which exposes further operations (e.g. loading all data as a\n        table, counting rows).\n\n        See the :meth:`Scanner.from_dataset` method for further information.\n\n        Parameters\n        ----------\n        columns : list of str, default None\n            The columns to project. This can be a list of column names to\n            include (order and dup""licates will be preserved), or a dictionary\n            with {new_column_name: expression} values for more advanced\n            projections.\n\n            The list of columns or expressions may use the special fields\n            `__batch_index` (the index of the batch within the fragment),\n            `__fragment_index` (the index of the fragment within the dataset),\n            `__last_in_fragment` (whether the batch is last in fragment), and\n            `__filename` (the name of the source file or a description of the\n            source fragment).\n\n            The columns will be passed down to Datasets and corresponding data\n            fragments to avoid loading, copying, and deserializing columns\n            that will not be required further down the compute chain.\n            By default all of the available columns are projected. Raises\n            an exception if any of the referenced column names does not exist\n            in the dataset's Schema.\n        filter : Expression, default None\n            Scan will return only the rows matching the filter.\n            If possible the predicate will be pushed down to exploit the\n            partition information or internal metadata found in the data\n            source, e.g. Parquet statistics. Otherwise filters the loaded\n            RecordBatches before yielding them.\n        batch_size : int, default 131_072\n            The maximum row count for scanned record batches. If scanned\n            record batches are overflowing memory then this method can be\n            called to reduce their size.\n        batch_readahead : int, default 16\n            The number of batches to read ahead in a file. This might not work\n            for all file formats. Increasing this number will increase\n            RAM usage but could also improve IO utilization.\n        fragment_readahead : int, default 4\n            The number of files to read ahead. Increasing this number will increase\n            R""AM usage but could also improve IO utilization.\n        fragment_scan_options : FragmentScanOptions, default None\n            Options specific to a particular scan and fragment type, which\n            can change between different scans of the same dataset.\n        use_threads : bool, default True\n            If enabled, then maximum parallelism will be used determined by\n            the number of available CPU cores.\n        cache_metadata : bool, default True\n            If enabled, metadata may be cached when scanning to speed up\n            repeated scans.\n        memory_pool : MemoryPool, default None\n            For memory allocations, if required. If not specified, uses the\n            default pool.\n\n        Returns\n        -------\n        scanner : Scanner\n\n        Examples\n        --------\n        >>> import pyarrow as pa\n        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],\n        ...                   'n_legs': [2, 2, 4, 4, 5, 100],\n        ...                   'animal': [\"Flamingo\", \"Parrot\", \"Dog\", \"Horse\",\n        ...                              \"Brittle stars\", \"Centipede\"]})\n        >>>\n        >>> import pyarrow.parquet as pq\n        >>> pq.write_table(table, \"dataset_scanner.parquet\")\n\n        >>> import pyarrow.dataset as ds\n        >>> dataset = ds.dataset(\"dataset_scanner.parquet\")\n\n        Selecting a subset of the columns:\n\n        >>> dataset.scanner(columns=[\"year\", \"n_legs\"]).to_table()\n        pyarrow.Table\n        year: int64\n        n_legs: int64\n        ----\n        year: [[2020,2022,2021,2022,2019,2021]]\n        n_legs: [[2,2,4,4,5,100]]\n\n        Projecting selected columns using an expression:\n\n        >>> dataset.scanner(columns={\n        ...     \"n_legs_uint\": ds.field(\"n_legs\").cast(\"uint8\"),\n        ... }).to_table()\n        pyarrow.Table\n        n_legs_uint: uint8\n        ----\n        n_legs_uint: [[2,2,4,4,5,100]]\n\n        Filte""ring rows while scanning:\n\n        >>> dataset.scanner(filter=ds.field(\"year\") > 2020).to_table()\n        pyarrow.Table\n        year: int64\n        n_legs: int64\n        animal: string\n        ----\n        year: [[2022,2021,2022,2021]]\n        n_legs: [[2,4,4,100]]\n        animal: [[\"Parrot\",\"Dog\",\"Horse\",\"Centipede\"]]\n        Cannot set fragment scan options for 'Cannot specify a schema when providing a RecordBatchReaderCannot specify a schema when providing an object implementing the Arrow PyCapsule Protocol\n        Convert a filter expression into a tuple of (directory, filename) using\n        the current partitioning scheme\n\n        Parameters\n        ----------\n        expr : pyarrow.dataset.Expression\n\n        Returns\n        -------\n        tuple[str, str]\n\n        Examples\n        --------\n\n        Specify the Schema for paths like \"/2009/June\":\n\n        >>> import pyarrow as pa\n        >>> import pyarrow.dataset as ds\n        >>> import pyarrow.compute as pc\n        >>> part = ds.partitioning(pa.schema([(\"year\", pa.int16()),\n        ...                                   (\"month\", pa.string())]))\n        >>> part.format(\n        ...     (pc.field(\"year\") == 1862) & (pc.field(\"month\") == \"Jan\")\n        ... )\n        ('1862/Jan', '')\n        <CsvFileFormat parse_options=Dataset.scanner (line 295)Expected a RecordBatchReader or an iterable of batches instead of the given type: Expected a Table, RecordBatch, list of Table/RecordBatch, or RecordBatchReader instead of the given type: Expected a list of tables or batches. The given list contains a Expected a list or a dict for 'columns', got Expected an Expression for a 'column' dictionary value, got Fragment count must be a non-negative int or None; got If `default_fragment_scan_options` is given, cannot specify convert_options or read_optionsIf `default_fragment_scan_options` is given, cannot specify read_optionsItem has schema\n<JsonFileFormat>Must pass ""either paths or a FileSelector, but passed Must provide schema to construct in-memory dataset from an empty listMust provide schema to construct scanner from an iterableNeither field_names nor schema was passed; cannot infer field_namesNoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Only one BoundExpressions with a single expression are supportedPartitioning.format (line 2587)Retrieving fragments of a filtered or projected dataset is not allowed. Remove the filtering.The number of files resulting from paths_or_selector must be equal to the number of partitions.Unknown segment encoding: Unknown segment encodingWriting datasets not yet implemented for this file format.), =]>?add_notecannot construct a FileSource from a path without a FileSystemcannot construct a FileSource from `default_fragment_scan_options` must be either a dictionary or an instance of CsvFragmentScanOptions`default_fragment_scan_options` must be either a dictionary or an instance of JsonFragmentScanOptionsdisableenableexisting_data_behavior must be one of 'error', gc, got ' has incorrect type (expected in-memory instead instead.isenabledleft outermax_partition_dictionary_size must be 0, -1, or None' on 'overwrite_or_ignore' or 'delete_matching' partition=[ path=pyarrow/_dataset.pyx<pyarrow.dataset.self.c_options,self.csv_options,self.wrapped cannot be converted to a Python object for picklingself.c_options,self.ipc_options,self.wrapped cannot be converted to a Python object for picklingself.c_options,self.wrapped cannot be converted to a Python object for picklingself.dataset,self.in_memory_dataset,self.wrapped cannot be converted to a Python object for picklingself.dataset,self.wrapped cannot be converted to a Python object for picklingself.factory,self.filesystem_factory,self.wrapped cannot be converted to a Python object for picklingself.factory,self.union_factor""y,self.wrapped cannot be converted to a Python object for picklingself.factory,self.wrapped cannot be converted to a Python object for picklingself.format,self.wrapped cannot be converted to a Python object for picklingself.fragment,self.wrapped cannot be converted to a Python object for picklingself.iterator cannot be converted to a Python object for picklingself.options cannot be converted to a Python object for picklingself.partitioning,self.wrapped cannot be converted to a Python object for picklingself.scanner,self.wrapped cannot be converted to a Python object for picklingself.wrapped cannot be converted to a Python object for pickling(tree fragment) type=utf-8\nwhich does not match expected schema\nArrayArrowTypeErrorBoundExpressionsBufferReaderCsvFileFormatCsvFileFormat.__reduce__CsvFileFormat.equalsCsvFileFormat.make_write_optionsCsvFileWriteOptionsCsvFileWriteOptions.__reduce_cython__CsvFileWriteOptions.__setstate_cython__CsvFragmentScanOptionsCsvFragmentScanOptions.__reduce__CsvFragmentScanOptions.equals_DEFAULT_BATCH_READAHEAD_DEFAULT_BATCH_SIZE_DEFAULT_FRAGMENT_READAHEADDatasetDatasetFactoryDatasetFactory.__reduce_cython__DatasetFactory.__setstate_cython__DatasetFactory.finishDatasetFactory.inspectDatasetFactory.inspect_schemasDataset.__reduce_cython__Dataset.__setstate_cython__Dataset._get_fragmentsDataset._scanner_optionsDataset.count_rowsDataset.filterDataset.get_fragmentsDataset.headDataset.joinDataset.join_asofDataset.replace_schemaDataset.scannerDataset.sort_byDataset.takeDataset.to_batchesDataset.to_tableDictionaryTypeDirectoryPartitioningDirectoryPartitioning.discoverFeatherFileFormatFileFormatFileFormat.__reduce_cython__FileFormat.__setstate_cython__FileFormat.inspectFileFormat.make_fragmentFileFormat.make_write_optionsFileFragmentFileFragment.__reduce__FileFragment.openFileSystemDatasetFileSystemDatasetFactoryFileSystemDatasetFactory.__reduce_cython__FileSystemDatasetFactory.__setstate_cython__FileSystemDataset.__reduce__FileSystemDataset.from""_pathsFileSystemFactoryOptionsFileSystemFactoryOptions.__reduce_cython__FileSystemFactoryOptions.__setstate_cython__FileWriteOptionsFileWriteOptions.__reduce_cython__FileWriteOptions.__setstate_cython__FilenamePartitioningFilenamePartitioning.discoverFragmentFragmentScanOptionsFragmentScanOptions.__reduce_cython__FragmentScanOptions.__setstate_cython__Fragment.__reduce_cython__Fragment.__setstate_cython__Fragment.count_rowsFragment.headFragment.scannerFragment.takeFragment.to_batchesFragment.to_table__HIVE_DEFAULT_PARTITION__HivePartitioningHivePartitioning.__reduce__HivePartitioning.discoverInMemoryDatasetInMemoryDataset.__reduce_cython__InMemoryDataset.__setstate_cython__IpcFileFormatIpcFileFormat.__reduce__IpcFileFormat.equalsIpcFileFormat.make_write_optionsIpcFileWriteOptionsIpcFileWriteOptions.__reduce_cython__IpcFileWriteOptions.__setstate_cython__JsonFileFormatJsonFileFormat.__reduce__JsonFileFormat.equalsJsonFragmentScanOptionsJsonFragmentScanOptions.__reduce__JsonFragmentScanOptions.equalsKeyValuePartitioningKeyValuePartitioning.__reduce__OrcFileFormatParquetFileFormatParquetFileFragmentParquetFileWriteOptionsParquetFragmentScanOptionsPartitioningPartitioningFactoryPartitioningFactory.__reduce__Partitioning.__reduce_cython__Partitioning.__setstate_cython__Partitioning.formatPartitioning.parse__Pyx_PyDict_NextRefRecordBatchRecordBatchIteratorRecordBatchIterator.__reduce_cython__RecordBatchIterator.__setstate_cython__RecordBatchReader_ScanNodeOptionsScanNodeOptionsScanNodeOptions.__init___ScanNodeOptions.__reduce_cython___ScanNodeOptions.__setstate_cython___ScanNodeOptions._set_optionsScannerScanner.__reduce_cython__Scanner.__setstate_cython__Scanner.count_rowsScanner.from_batchesScanner.from_datasetScanner.from_fragmentScanner.headScanner.scan_batchesScanner.takeScanner.to_batchesScanner.to_readerScanner.to_tableTableTaggedRecordBatchTaggedRecordBatchIteratorTaggedRecordBatchIterator.__reduce_cython__TaggedRecordBatchIterator.__setstate_cython__UnionDatasetU""nionDatasetFactoryUnionDatasetFactory.__reduce_cython__UnionDatasetFactory.__setstate_cython__UnionDataset.__reduce__WrittenFileWrittenFile.__reduce_cython__WrittenFile.__setstate_cython__argargsarrayarrow__arrow_c_stream__as_pyascendingasyncio.coroutinesbase_dirbasename_templatebatchbatch_iterbatch_readaheadbatch_sizebufferbuilderbyc_field_namesc_filesystemc_filterc_fragmentc_fragmentsc_indicesc_optionsc_pathc_resultc_scan_optionsc_scannerc_schemac_sourcecache_metadatachildren__class__class___class_getitem__cline_in_tracebackcloseclscoalesce_keyscodecscollectionscolumns_constructor_directory_partitioning_factory_constructor_filename_partitioning_factory_constructor_hive_partitioning_factoryconvert_optionscopycount_rowscreate_dircsvcurrent_filterddatadataset_dataset_parquet_dataset_pqdefaultdefault_fragment_scan_optionsdelete_matching__dict___dictdictionariesdirectorydiscover__doc__eenumerateequalserrorexclude_invalid_filesexisting_data_behaviorexprexpressionexpressionsffactoriesfeatherfield_namesfilefile_optionsfile_sizefile_visitorfilenamefilesystem_filesystemdataset_writefilterfiltered_datasetfinish_forbid_instantiationformatfragmentfragment_readaheadfragment_scan_optionsfragmentsfrom_batchesfrom_datasetfrom_fragmentfrom_pathsfrom_streamfrombytes__func__get_get_fragmentsget_fragments_get_orc_fileformat_get_parquet_classes_get_parquet_symbolget_partition_keys__getstate__headhiveiimplicit_orderingindicesinfer_dictionary__init__inspectinspect_schemasipc_is_coroutine_is_iterable_is_path_likeitems_iteratoriteratorjoinjoin_asofjoin_typejsonkeyskwargsleft_suffixlookup__main__make_fragmentmake_write_optionsmax_open_filesmax_partition_dictionary_sizemax_partitionsmax_rows_per_filemax_rows_per_groupmaybe_fragmentmemory_pool__metaclass__metadatamin_rows_per_group__module____mro_entries__name__name__namedtuplenames__new__new_filternew_optionsnextnonenull_fallbacknum_rowsonopenopenedoptionsoptsorc_orc_fileformat_orc_importedotheroutoutput_typeoverwrite_or_ignorepapa_substrait""_pacparquetparseparse_optionspartition_base_dirpartition_expressionpartitioningpartitioning_factorypartitionspathpathspaths_or_selector_perform_join_perform_join_asofphysical_schemapop__prepare__preserve_orderpromote_optionspyarrowpyarrow._computepyarrow._datasetpyarrow._dataset_orcpyarrow._dataset_parquetpyarrow.libpyarrow.substraitpyarrow.util__pyx_capi____pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_WrittenFile__pyx_vtable____qualname__readread_options_read_options_pyreaderrecord_batch__reduce____reduce_cython____reduce_ex__ref_valreplace_schemarequested_filterrequire_sequenced_outputresresultright_byright_datasetright_keysright_onright_suffixroot_partitions_scalarscan_batches_scan_optionsscan_optionsscanner_scanner_optionsschemaschemassegment_encodingselector_ignore_prefixesselfsend_set_default_fragment_scan_options__set_name___set_optionssetdefault__setstate____setstate_cython__size__slots__sort_bysort_keys_sort_sourcesortingsourcesp_schemasp_write_optionsstatestaticmethod_stringify_pathsubclasses_insteadsubstraitsupertake__test__throwto_batchesto_batches.<locals>._iteratorto_readerto_tabletobytestolerancetypetype_nameunionupdateuriuse_setstateuse_threadsvalvaluevaluesvisit_argswrite_optionszip arrow::Field::MergeOptions (PyObject *)\000 arrow::MemoryPool *(struct __pyx_obj_7pyarrow_3lib_MemoryPool *)\000PyObject *(std::shared_ptr< arrow::Array>  const &)\000PyObject *(std::shared_ptr< arrow::Buffer>  const &)\000PyObject *(std::shared_ptr< arrow::RecordBatch>  const &)\000PyObject *(std::shared_ptr< arrow::Scalar>  const &)\000PyObject *(std::shared_ptr< arrow::Schema>  const &)\000PyObject *(std::shared_ptr< arrow::Table>  const &)\000int (arrow::Status const &)\000std::shared_ptr< arrow::Array>  (PyObject *)\000std::shared_ptr< arrow::Buffer>  (PyObject *)\000std::shared_ptr< arrow::Schema>  (PyObject *)\000std::shared_ptr< arrow::Table>  (PyObject *)\000std::shared_ptr<std::function<__pyx_t_7pyarrow_8includes_8libarrow_StreamWrapFunc> >  (PyO""bject *, PyObject *)\000struct __pyx_obj_7pyarrow_3lib_NativeFile *(PyObject *, bool)\000_parse_field_merge_options\000maybe_unbox_memory_pool\000pyarrow_wrap_array\000pyarrow_wrap_buffer\000pyarrow_wrap_batch\000pyarrow_wrap_scalar\000pyarrow_wrap_schema\000pyarrow_wrap_table\000check_status\000pyarrow_unwrap_array\000pyarrow_unwrap_buffer\000pyarrow_unwrap_schema\000pyarrow_unwrap_table\000make_streamwrap_func\000get_native_filearrow::compute::Expression\000_truearrow::compute::Expression (struct __pyx_obj_7pyarrow_8_compute_Expression *, struct __pyx_obj_7pyarrow_3lib_Schema *)\000_bindarrow::dataset::FileSource (PyObject *, struct __pyx_opt_args_7pyarrow_8_dataset__make_file_source *__pyx_optional_args)\000_make_file_source\200\001\330\004\013\320\013 \240\t\250\022\2501\320\004#\2401\360&\000\t\014\2107\220'\230\021\330\014\030\320\030-\250Q\250a\330\021\022\330\020\031\230\024\230X\320%6\260a\260q\340\021\022\330\020\031\230\024\230X\240W\250A\340\010\026\220e\2301\230N\250!\2501\200\001\3602\000\t\034\320\033/\250w\260a\360\006\000\005\013\210!\330\004\010\210\013\220>\240\021\320\":\270!\2706\300\021\330\010\017\210w\220f\230E\240\023\240C\240q\330\010\017\210w\220g\230U\240#\240S\250\001\330\010\016\320\016!\240\021\240'\250\027\260\007\260q\330\010\013\2101\210I\220Q\220f\230G\2406\250\025\250h\260c\270\026\270q\330\004\013\2101\200\001\3602\000\005\016\320\r#\240<\250w\260a\330\004\r\210^\230:\240W\250A\330\004\r\210\\\230\027\240\001\240\037\260\001\260\021\330\004\r\320\r\035\230\\\250\027\260\001\330\004\r\320\r\037\230q\330\004\r\320\r\037\230q\330\004\r\320\r\037\230q\330\004\r\320\r\"\240!\330\004\r\320\r#\2401\330\004\r\320\r#\2401\330\004\r\320\r\"\240'\250\021\250!\330\004\007\320\007\036\230c\240\021\330\010\021\320\021+\2501\330\t \240\003\2401\330\010\021\220\021\330\014\r\330\t \240\003\2401\330\010\021\320\021+\2501\340\010\016\210j\230\001\330\r\016\330\r\016\340\004\r\210^\2301\340\004\007\200}\220G\2301\330\010\026\220l\240)\2501\330\026&""\240a\360\006\000\t\022\320\021'\240|\3203N\310a\330\014\r\320\r/\250q\340\004\020\220\004\220G\2301\330\t\n\330\010\024\320\024'\240v\250Q\250k\270\021\320\0043\3203C\3001\330\031,\320,@\300\001\330\031\032\360N\001\000\t\014\210;\220c\230\021\330\014\031\230\021\330\010\017\210t\2202\220^\2401\330\014\027\220v\230V\240?\260!\330\014\030\230\r\240]\260!\330\014\030\230\r\240^\2601\330\014\030\230\001\200\001\360\n\000\005\006\330\004\007\200|\2203\220a\330\010\t\330\023\024\330\017\020\330\014\032\230!\200\001\330\004\013\320\013\033\2309\240B\240a\200A\200A\330CD\330%=\270Q\330%&\330*+\330-.\330@A\330'A\300\021\330-.\360x\001\000\r0\250{\270.\310\001\360\010\000\t\022\220\027\230\003\2308\2401\340\010\022\220+\320\035.\250a\320/D\300A\300Q\330/7\260w\270d\300!\330\010\031\230\021\320\032+\320+;\2701\330%A\300\021\330-.\330&B\300!\330&'\33001\340\010\022\220.\240\001\240\027\250\004\250B\250g\260Q\330\010\026\220e\2301\230A\200A\330\"#\330/0\330\037 \330\030\031\330\"#\360H\001\000\t\014\320\013)\250\025\250c\260\021\330\014\037\230q\330\r+\2503\250a\330\014\022\320\022%\240Q\240a\360\006\000\t\014\2101\330\014\025\320\025)\250\021\340\010\021\320\021\"\240'\250\021\250!\340\010\013\2101\330\014\025\220Z\320\0374\260A\260Q\340\010\021\320\021%\320%:\270!\2701\340\010\"\240%\240q\330\035)\250\021\250!\330\014\r\330\r\037\320\037>\270a\330\r\025\220Q\200A\360\006\000\r+\250!\330\014#\2401\340\010 \320 3\2601\260I\270Q\340\010!\240\034\250T\260\021\3202N\310a\330\010\032\230,\240d\250!\320+@\300\001\340\010\014\210H\220F\230!\330\014 \240\001\240\027\250\007\250t\3203C\320C]\320]^\200A\360\020\000\t\022\320\021\"\240(\250!\2501\330\010\016\210j\230\016\240a\240t\2508\3203G\300q\330\010\017\210q\200A\330&3\2601\330\036/\320/D\300A\360(\000\t\014\210?\230#\230Q\330\014\035\230Q\340\010\014\210E\220\030\230\030\240\021\330\r\025\220X\230Q\330\r\025\220\\\240\021\330\r\031\230\034\240Q\330\r\035\230\\\250\021\340\014\017\210t\220:\230Q\230e\2401\330\020\026\220i\230q\330""\024 \240\001\320!E\300Q\300f\310A\330\024\032\230!\2304\230q\240\001\360\006\000\t\026\220[\240\003\2401\240I\250S\260\001\260\021\340\010\013\2103\210a\210w\220c\230\023\230A\230Q\330\014\022\220*\230A\330\020\021\360\010\000\t\025\220A\330\014\022\220.\240\001\240\026\240|\260:\270Q\270a\330\014\020\220\003\2208\2309\240A\240Q\340\010\017\320\017 \240\001\240\033\250H\260A\330!-\250Q\200A\330\0354\260A\330/0\330\030/\250q\360H\001\000\t\014\320\013)\250\025\250c\260\021\330\014\037\230q\330\r+\2503\250a\330\014\022\320\022%\240Q\240a\360\006\000\t\014\2101\330\014\025\320\025)\250\021\340\010\013\2101\330\014\025\220Z\320\0374\260A\260Q\330\014\034\230A\230W\240A\240Q\240g\250T\260\025\260a\330\r\021\220\021\330\014\022\220*\230A\330\020\021\360\006\000\r\035\230A\230W\240A\240S\250\004\250E\260\021\340\010\021\320\021%\320%:\270!\2701\340\010\"\240%\240q\330\".\250a\250\177\270a\330\014\r\330\r\032\320\032,\250A\330\r\025\220Q\200A\330\0354\260A\330\030/\250q\360@\001\000\t\014\2101\330\014\025\320\025)\250\021\340\010\013\2101\330\014\025\220Z\320\0374\260A\260Q\330\014\034\230A\230W\240A\240Q\240g\250T\260\025\260a\330\r\021\220\021\330\014\022\220)\2301\330\020\021\360\006\000\r\035\230A\230W\240A\240S\250\004\250E\260\021\340\010\021\320\021%\320%:\270!\2701\340\010\"\240%\240q\330!-\250Q\250o\270Q\330\014\r\330\r\032\320\032,\250H\260A\200A\330\010\033\2304\230w\320&:\270!\330\010\013\320\013\033\2304\230s\240#\240Q\360\006\000\r\023\320\022%\240Q\330\020\021\340\010\037\230u\240A\240Q\200A\360(\000\t\014\2104\210z\230\021\230)\2402\240Q\330\014\026\220b\230\006\230a\230q\330\010\024\320\024(\250\001\250\021\340\r\016\330\014\025\220T\230\030\240\031\250!\2506\260\021\330\010\017\320\017!\240\021\240.\260\001\260\021\200A\340\034\035\330\037 \330\034\035\330!\"\330$%\33078\330\036\037\330!\"\330$%\360z\001\000\t\020\210t\2208\2301\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014""\033\2301\330\014\030\230\001\330\t\016\210a\210q\200A\330\010\017\320\017 \240\004\240A\200A\330\010\017\320\017(\250\004\250A\330(,\250A\200A\340$%\330#$\330$%\330)*\330,-\330?@\330&@\300\001\330,-\360|\001\000\t\032\320\031,\250A\330\014\r\330\021\031\230\031\240'\250\030\260\033\270A\330\021!\240\021\330\021$\320$8\270\014\300A\330\021 \320 0\260\014\270A\330\021'\240q\340\010\022\220+\320\035.\250a\250w\260g\270T\300\021\330\010\022\220.\240\001\240\027\250\004\250B\250g\260Q\330\010\026\220e\2301\230A\200A\330.C\3001\330'<\270A\330)*\330,-\330?@\330&@\300\001\330,-\360N\002\000\t\014\210:\220Q\220h\230b\240\004\240A\330\014\017\210q\330\020\026\220j\240\001\240\021\340\014\025\220Q\330\r\024\220A\220X\230Q\330\014\017\210q\330\020\026\220j\240\001\330\024\025\340\014\025\220R\220t\320\033-\250\\\270\021\270!\330\r\031\230\021\230!\330\014\017\210w\220c\230\021\330\020\026\220j\240\001\240\021\340\014\025\220R\220t\320\033-\250]\270!\2708\3001\340\014\022\220)\2301\230A\330BC\330\034 \240\001\240\027\250\001\330\010!\320!7\260q\270\006\270a\330\010\031\230\021\320\032+\320+;\2701\330%A\300\021\330-M\310Q\330)E\300Q\33001\330\010\022\220.\240\001\240\027\250\004\250B\250g\260Q\330\010\026\220e\2301\230A\200A\330\036\037\330\037 \330\"#\330\037 \330$%\330'(\330:;\330!\"\330$%\330'(\360F\002\000\t\020\210w\220n\240A\330\014\r\330\014\023\2201\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\200A\330\010\014\210M\230\021\230)\2401\200A\330%&\330\"#\330'(\330*+\330=>\330$%\330'(\330*+\360P\001\000\t\020\210t\2208\2301\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\330\t\024\220A\200A\360 \000\t\026\220Q\330\010\031\230\024\230^\2504\250q\260\001\330\010\013\210?\230'\240\025\240d\250+\260W\270A\330\014\031\230\037\250\002\250!\340\010\033\2304\230z\250\030\260\021\260$""\260a\330\010\030\230\005\230Q\230d\240!\330\010\030\320\030-\250Q\250g\260Q\330\010\017\210q\200A\330\010\021\220\024\220Q\330\010\017\210t\2207\230!\330\014\020\220\t\230\027\240\003\240:\250Q\330\014\020\220\001\330\014\020\220\001\200A\360(\000\t\014\210:\220Q\220i\230q\330\014\026\220b\230\t\240\021\340\010\016\210d\220\"\220M\240\021\330\014\022\220,\320\036/\250z\270\033\300A\340\010\017\210q\200A\330\010\017\320\017)\250\024\320-=\270T\300\021\200A\360\022\000\016\017\330\014\025\220T\230\030\240\032\2501\330\010\017\210~\230Q\230a\200A\360\032\000\016\017\330\014\025\220T\230\030\240\030\250\021\340\010\017\320\017!\240\021\240.\260\001\260\021\200A\360\006\000\016\017\330\014\025\220T\230\030\240\037\260\001\260\021\340\010\022\220!\330\010\014\210E\220\036\230q\240\001\330\014\023\2207\230!\320\033.\250a\250q\330\010\017\210q\200A\360\034\000\016\017\330\014\025\220T\230\030\240\025\240a\240q\330\010\017\320\017!\240\021\240.\260\001\260\021\200A\360\024\000\t\n\330\014\022\220!\330\014\020\220\r\230W\240A\240U\250/\270\021\330\014\020\220\016\230g\240Q\240e\2501\200A\360\020\000\r\036\230Z\240q\360\006\000\t\014\2104\210x\220w\230a\330\014\023\2202\220]\240!\2404\240q\340\010\013\2104\210~\230W\240B\240k\260\023\260C\260q\330\014\025\220W\230A\230T\240\036\250w\260b\270\005\270Q\330\021\022\330\020\037\230t\240>\260\027\270\002\270+\300Q\330\020\031\230\036\240q\250\014\260D\270\002\270.\310\001\310\021\340\021\022\330\020\031\230\036\240q\250\004\250N\270'\300\022\3005\310\001\340\010\013\320\013\"\240!\2401\330\010\013\210?\230!\330\010\017\210q\200A\360\024\000\t\021\220\006\220a\330\020\024\320\0243\2601\330\020\025\220Q\200A\360\032\000\t\022\220\024\220]\240&\250\001\250\027\260\001\260\021\330\010\031\230\025\230a\230~\250Q\250a\200A\330\010\017\210\177\230d\240)\2504\250q\200A\330\010\017\210\177\230e\2401\200A\360\024\000\t\n\330\014\020\220\016\230g\240Q\240e\320+;\2701\330\014\020\320\020/\250q\330\014\021\220\021\200A\360\014\000\t\027\220g""\230U\240!\360\006\000\t\034\2307\240$\240a\240q\330\010\013\210=\230\004\230J\240a\320'9\270\034\300Q\330\014\032\230$\230a\320\037/\250|\2707\300!\330\014\017\210s\220!\220=\240\003\2401\330\020\026\220j\240\001\330\024\025\330\014\027\220q\230\014\320$7\260{\300!\3001\340\010\031\230\024\230^\2504\250q\260\001\330\010\013\320\013\034\230G\2405\250\004\250O\2707\300!\330\014\027\220q\230\014\240O\2602\260Q\330\r\034\230G\2401\330\014\027\220q\230\014\240A\340\010\017\210q\200A\360\024\000\t\020\210q\200A\330\010\017\210q\330\014\020\220\001\220\024\220^\2401\330\014\020\220\001\330\014\020\220\001\330\014\020\220\001\330\014\020\220\001\200A\360\024\000\t\n\330\014\"\240*\320,?\270q\300\001\330\010\014\320\014\035\230\\\250\023\250A\330\010\017\210q\200A\360>\000\t\022\220\036\230q\240\004\240M\260\027\270\001\330\026\035\230Q\230a\360\006\000\t\020\210y\230\001\230\026\230}\250I\260Q\260f\270A\200A\360\024\000\t\n\330\014\"\240*\320,?\270q\300\001\330\010\014\320\014\035\230_\250C\250q\330\010\017\210q\200A\360\032\000\t*\250\036\260q\330\014\020\220\010\230\016\240a\320'<\270A\270Q\360\006\000\t\024\2205\230\001\230\024\230Q\230a\330\010\013\2104\210q\340\014\r\320\r\036\230d\240.\260\005\260Q\330\010\017\210q\200A\360\024\000\t\n\330\014\022\220!\330\014\020\320\020 \240\007\240q\250\005\320-?\270q\330\014\020\220\r\230W\240A\240U\250!\200A\360\022\000\016\017\330\014\027\220t\2301\230N\250!\2504\250x\260|\3001\340\010(\250\005\250Q\250f\260D\270\001\270\021\200A\330\010\017\320\017\037\230t\2401\330\037#\2401\200A\330\010\027\220t\2301\330\010\013\2101\330\014\033\2304\230q\240\003\2401\240D\250\007\250x\260q\330\010\033\320\0331\260\021\330\014\022\220$\320\026-\320->\270a\340\010\030\230\t\240\021\240&\250\004\320,?\270~\310Q\330\010\017\210q\330\014\020\220\t\230\036\240\177\260a\200A\330\010\027\220t\2301\330\010\013\2101\330\014\033\2304\230q\240\003\2401\240D\250\007\250x\260q\330\010\033\320\0331\260\021\330\014\022\220$\320\026-\320->\270a\340\010\017""\210t\220=\240\004\240I\250^\2701\200A\330\037 \330 !\330#$\330 !\330%&\330()\330;<\330\"#\330%&\330()\360@\002\000\t\020\210t\2208\2301\330\014\023\2201\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\330\t\022\220!\200A\330 !\330#$\330 !\330%&\330()\330;<\330\"#\330%&\330()\360|\001\000\t\020\210t\2208\2301\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\330\t\022\220!\200A\330\010\017\210t\220>\240\024\240Q\200A\330\"#\330%&\330\"#\330'(\330*+\330=>\330$%\330'(\330*+\360v\001\000\t\020\210t\2208\2301\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\330\t\024\220A\200A\330\037 \330\036\037\330\037 \330$%\330'(\330:;\330!\"\330$%\330'(\360^\003\000\t\020\210w\220m\2401\330\014\r\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\200A\360\020\000\t\n\360\010\000\t\020\210y\230\001\230\024\230]\250!\200A\330!\"\330\"#\330%&\330\"#\330'(\330*+\330=>\330$%\330'(\330*+\360z\001\000\t\020\210w\220n\240A\330\014\r\330\014\023\2201\330\014\024\220A\330\014\023\2201\330\014\027\220q\330\014\034\230A\330\014\037\230q\330\014\"\240!\330\014\030\230\001\330\014\033\2301\330\014\030\230\001\330\t\024\220A\320\004C\300?\320RS\360x\001\000\t\014\2109\220C\220q\330\014\027\220q\330\010\013\2109\220C\220q\330\014\027\220q\330\010\017\210t\2202\320\025(\250\001\250\026\250t\2601\330)8\270\n\300!\330)4\260L\300\001\200\001\330\004\n\210+\220Q\320\004-\250Q\33067\330#$\360.\000\t\014\320\013 \240\003\2401\330\014#\2401\330\010\023\320\023$\240A\240V\250<\260q\330\010\025\320\025-\250^\2701\330\014\020\220\007\220}\240A\240T\250\021\250!\330%9\270\027\300\001""\330%:\270!\330\010\027\220u\230A\230T\240\021\240!\200\001\360\010\000\005\016\210T\220\033\230D\240\007\240t\2501\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\230:\240W\250E\260\023\260D\270\006\270g\300Q\330\004\007\200q\330\010\017\320\017,\250D\260\001\260\027\270\013\3007\310!\340\010\017\320\017,\250D\260\001\260\027\270\013\3001\210\001\200\001\330\004)\250\021\250&\260\001\320\004.\250a\360\034\000\t\014\2104\210~\230T\240\021\240*\250G\2601\360\010\000\r\023\220*\230A\330\020\021\360\010\000\t\020\210t\220?\240!\2401\320\004)\320)>\270a\360,\000\t\020\320\017&\320&@\300\001\300\021\340\010\013\210:\220S\230\001\330\014\023\220>\240\021\330\r\027\220q\230\013\2405\250\004\250J\260c\270\021\330\014\023\220=\240\001\340\014\022\220*\230A\330\020I\310\021\310!\340\r\016\330\014\025\220T\230\030\240\030\250\021\250!\330\010\017\320\017\"\240!\240>\260\021\260!\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220;\230h\240a\240q\330\004\007\200|\2207\230!\330\010-\250Q\250n\270N\310!\330\004\013\2101\320\004'\240q\360$\000\r$\320#4\260A\260V\320;Q\320QR\340\r\016\330\014\027\220t\2307\240(\250!\2501\330\010\023\220>\240\021\240!\330\010\017\320\017\"\240!\2404\240q\250\001\200\001\360\n\000\005\006\330\004\005\330\004\007\200t\2101\330\010\t\330\014\021\320\021-\250Q\330\014\036\230a\330\010\017\210\177\230a\330\014\036\230a\340\014\034\230A\330\004\013\2101\200\001\360\n\000\005\031\230\001\330\004\013\210<\220t\2307\240!\240=\260\001\200\001\330\004\013\320\013\037\230y\250\002\250!";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 519; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 84) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 519; i < 595; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 595; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 519;
      for (Py_ssize_t i=0; i<76; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
        }
        #else
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int8_t const cint_constants_1[] = {0,-1,1,4,16};
    int32_t const cint_constants_4[] = {131072L,45017777L};
    for (int i = 0; i < 7; i++) {
      numbertab[i] = PyLong_FromLong((i < 5 ? cint_constants_1[i - 0] : cint_constants_4[i - 5]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<7; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 4;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 4;
    unsigned int nlocals : 5;
    unsigned int flags : 10;
    unsigned int first_line : 13;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 256};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_c_filter, __pyx_mstate->__pyx_n_u_c_fragments, __pyx_mstate->__pyx_n_u_maybe_fragment};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_fragments, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 3933};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_batch_iter, __pyx_mstate->__pyx_n_u_batch};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_iterator, __pyx_mstate->__pyx_kp_b_iso88591__57, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_OrcFileFormat, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_orc_fileformat, __pyx_mstate->__pyx_kp_b_iso88591_t1_Q_a_a_a_A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_parquet_classes, __pyx_mstate->__pyx_kp_b_iso88591_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_name};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_parquet_symbol, __pyx_mstate->__pyx_kp_b_iso88591_t7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 208};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_n_u_d};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_replace_schema, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_AQ_5_Qa_4q_d_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 231};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filter};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_fragments_2, __pyx_mstate->__pyx_kp_b_iso88591_a_4_T_G1_A_t_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_new_options, __pyx_mstate->__pyx_n_u_requested_filter, __pyx_mstate->__pyx_n_u_expressions, __pyx_mstate->__pyx_n_u_current_filter};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_scanner_options, __pyx_mstate->__pyx_kp_b_iso88591_A_gU_7_aq_Ja_9_Q_a_7_s_1_j_q_7_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_scanner, __pyx_mstate->__pyx_kp_b_iso88591_A_wm1_A_1_q_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 428};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_batches, __pyx_mstate->__pyx_kp_b_iso88591_A_v_t81_A_1_q_A_q_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 508};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_table, __pyx_mstate->__pyx_kp_b_iso88591_A_t81_A_1_q_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 591};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_take, __pyx_mstate->__pyx_kp_b_iso88591_A_78_z_t81_A_1_q_A_q_1_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 674};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_head, __pyx_mstate->__pyx_kp_b_iso88591_A_78_z_t81_A_1_q_A_q_1_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 757};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_count_rows, __pyx_mstate->__pyx_kp_b_iso88591_A_P_t81_1_q_A_q_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_expression, __pyx_mstate->__pyx_n_u_filtered_dataset, __pyx_mstate->__pyx_n_u_new_filter, __pyx_mstate->__pyx_n_u_current_filter};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_4q_d_WA_4z_a_Qd_QgQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 847};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sorting, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_sort_by, __pyx_mstate->__pyx_kp_b_iso88591_A_Qiq_b_d_M_z_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_right_dataset, __pyx_mstate->__pyx_n_u_keys, __pyx_mstate->__pyx_n_u_right_keys, __pyx_mstate->__pyx_n_u_join_type, __pyx_mstate->__pyx_n_u_left_suffix, __pyx_mstate->__pyx_n_u_right_suffix, __pyx_mstate->__pyx_n_u_coalesce_keys, __pyx_mstate->__pyx_n_u_use_threads};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_join, __pyx_mstate->__pyx_kp_b_iso88591_33C1_N_c_t2_1_vV_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 925};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_right_dataset, __pyx_mstate->__pyx_n_u_on, __pyx_mstate->__pyx_n_u_by, __pyx_mstate->__pyx_n_u_tolerance, __pyx_mstate->__pyx_n_u_right_on, __pyx_mstate->__pyx_n_u_right_by};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_join_asof, __pyx_mstate->__pyx_kp_b_iso88591_C_RSx_9Cq_q_9Cq_q_t2_t1_8_4L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1089};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_d_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1185};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1194};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_paths, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_filesystem, __pyx_mstate->__pyx_n_u_partitions, __pyx_mstate->__pyx_n_u_root_partition, __pyx_mstate->__pyx_n_u_arg, __pyx_mstate->__pyx_n_u_class_2, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_fragments, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_path_2};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_from_paths, __pyx_mstate->__pyx_kp_b_iso88591_A_31_DA_Q_Q_E_XQ_Q_t_Qe1_iq_EQfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1331};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_file, __pyx_mstate->__pyx_n_u_filesystem, __pyx_mstate->__pyx_n_u_c_source, __pyx_mstate->__pyx_n_u_c_result, __pyx_mstate->__pyx_n_u_c_schema};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_inspect, __pyx_mstate->__pyx_kp_b_iso88591_q_4AV_QQR_t7_1_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 1, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1356};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_file, __pyx_mstate->__pyx_n_u_filesystem, __pyx_mstate->__pyx_n_u_partition_expression, __pyx_mstate->__pyx_n_u_file_size, __pyx_mstate->__pyx_n_u_c_source, __pyx_mstate->__pyx_n_u_c_fragment};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_make_fragment, __pyx_mstate->__pyx_kp_b_iso88591_Q67_1_1_AV_q_1_AT_9_uAT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sp_write_options};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_make_write_options, __pyx_mstate->__pyx_kp_b_iso88591_A_4w_4s_Q_Q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_scanner, __pyx_mstate->__pyx_kp_b_iso88591_A_F_wnA_1_A_1_q_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1577};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_batches, __pyx_mstate->__pyx_kp_b_iso88591_A_z_wnA_1_A_1_q_A_q_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1662};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_table, __pyx_mstate->__pyx_kp_b_iso88591_A_t81_1_A_1_q_A_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1749};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_take, __pyx_mstate->__pyx_kp_b_iso88591_A_78_z_t81_A_1_q_A_q_1_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_head, __pyx_mstate->__pyx_kp_b_iso88591_A_78_z_t81_A_1_q_A_q_1_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1915};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_count_rows, __pyx_mstate->__pyx_kp_b_iso88591_A_P_t81_1_q_A_q_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1997};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buffer};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_t7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2005};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_filesystem, __pyx_mstate->__pyx_n_u_opened, __pyx_mstate->__pyx_n_u_c_path, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_open, __pyx_mstate->__pyx_kp_b_iso88591_A_Zq_4xwa_2_4q_4_WBk_Cq_WAT_wb_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2147};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 2159};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_opts};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_make_write_options, __pyx_mstate->__pyx_kp_b_iso88591_A_q__Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2178};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 2244};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_opts};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_make_write_options, __pyx_mstate->__pyx_kp_b_iso88591_A_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2275};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_gQe_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2290};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2356};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_WAU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2371};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2450};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_a_31_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2464};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2517};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_WAU_gQe1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2571};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_path_2, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_parse, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2587};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_expr, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_kp_b_iso88591_A_q_M_Qa_y_IQfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2653};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_t_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2694};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dictionaries, __pyx_mstate->__pyx_n_u_segment_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_1_4q_1D_xq_1_a_t_I_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 2726};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_constructor_directory_partition, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2786};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_field_names, __pyx_mstate->__pyx_n_u_infer_dictionary, __pyx_mstate->__pyx_n_u_max_partition_dictionary_size, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_segment_encoding, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_field_names, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_discover, __pyx_mstate->__pyx_kp_b_iso88591_A_4A_0_qH_c_q_3a_Qa_1_1_Z_4AQ_AW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 2854};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_constructor_hive_partitioning_f, __pyx_mstate->__pyx_kp_b_iso88591_9Ba, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dictionaries, __pyx_mstate->__pyx_n_u_segment_encoding, __pyx_mstate->__pyx_n_u_null_fallback};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_1_4q_1D_xq_1_a_Q_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2940};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_infer_dictionary, __pyx_mstate->__pyx_n_u_max_partition_dictionary_size, __pyx_mstate->__pyx_n_u_null_fallback, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_segment_encoding, __pyx_mstate->__pyx_n_u_c_options};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_discover, __pyx_mstate->__pyx_kp_b_iso88591_A_0_H_c_q_3a_Qa_1_1_Z_4AQ_1_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 3005};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_constructor_filename_partitioni, __pyx_mstate->__pyx_kp_b_iso88591_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3065};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_field_names, __pyx_mstate->__pyx_n_u_infer_dictionary, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_segment_encoding, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_field_names, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_discover, __pyx_mstate->__pyx_kp_b_iso88591_A_4A_q_1_1_Z_4AQ_AWAQgT_a_1_AWAS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3152};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_schemas, __pyx_mstate->__pyx_n_u_s};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_inspect_schemas, __pyx_mstate->__pyx_kp_b_iso88591_A_T_E_q_7_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 2, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_promote_options, __pyx_mstate->__pyx_n_u_fragments, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_inspect, __pyx_mstate->__pyx_kp_b_iso88591_a_S_q_5_Jc_A_I_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_sp_schema, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_finish, __pyx_mstate->__pyx_kp_b_iso88591_1_7_Qa_X_6aq_XWA_e1N_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 9, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3633};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_dataset, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_builder, __pyx_mstate->__pyx_n_u_scanner};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_from_dataset, __pyx_mstate->__pyx_kp_b_iso88591_A_A_A_8_A_0_A_q_awgT_BgQ_e1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 10, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3716};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_fragment, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_builder, __pyx_mstate->__pyx_n_u_scanner};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_from_fragment, __pyx_mstate->__pyx_kp_b_iso88591_ACD_Q_A_A_x_0_81_a_DAQ_7wd_1_A_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 10, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3802};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_columns, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_batch_readahead, __pyx_mstate->__pyx_n_u_fragment_readahead, __pyx_mstate->__pyx_n_u_fragment_scan_options, __pyx_mstate->__pyx_n_u_use_threads, __pyx_mstate->__pyx_n_u_cache_metadata, __pyx_mstate->__pyx_n_u_memory_pool, __pyx_mstate->__pyx_n_u_builder, __pyx_mstate->__pyx_n_u_scanner, __pyx_mstate->__pyx_n_u_reader};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_from_batches, __pyx_mstate->__pyx_kp_b_iso88591_A_C1_A_N_Qhb_A_q_j_Q_AXQ_q_j_Rt, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3925};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iterator, __pyx_mstate->__pyx_n_u_iterator};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_batches, __pyx_mstate->__pyx_kp_b_iso88591_A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3939};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iterator_2};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_scan_batches, __pyx_mstate->__pyx_kp_b_iso88591_A_t1N_4x_1_QfD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3953};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_table, __pyx_mstate->__pyx_kp_b_iso88591_A_T_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3971};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_take, __pyx_mstate->__pyx_kp_b_iso88591_A_4z_2Q_b_aq_T_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3999};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_num_rows, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_head, __pyx_mstate->__pyx_kp_b_iso88591_A_T_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4017};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_count_rows, __pyx_mstate->__pyx_kp_b_iso88591_A_T_1_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4030};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reader};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_to_reader, __pyx_mstate->__pyx_kp_b_iso88591_A_1_j_at83Gq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4043};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_partition_expression, __pyx_mstate->__pyx_n_u_expr, __pyx_mstate->__pyx_n_u_ref_val, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_get_partition_keys, __pyx_mstate->__pyx_kp_b_iso88591_2_wa_6_wfE_Cq_wgU_S_q_1IQfG6_hc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_D_t1_G1F_a_vWE_Q_q_t_WE_D_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591__58, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {15, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_base_dir, __pyx_mstate->__pyx_n_u_basename_template, __pyx_mstate->__pyx_n_u_filesystem, __pyx_mstate->__pyx_n_u_partitioning, __pyx_mstate->__pyx_n_u_preserve_order, __pyx_mstate->__pyx_n_u_file_options, __pyx_mstate->__pyx_n_u_max_partitions, __pyx_mstate->__pyx_n_u_file_visitor, __pyx_mstate->__pyx_n_u_existing_data_behavior, __pyx_mstate->__pyx_n_u_max_open_files, __pyx_mstate->__pyx_n_u_max_rows_per_file, __pyx_mstate->__pyx_n_u_min_rows_per_group, __pyx_mstate->__pyx_n_u_max_rows_per_group, __pyx_mstate->__pyx_n_u_create_dir, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_scanner, __pyx_mstate->__pyx_n_u_visit_args};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_filesystemdataset_write, __pyx_mstate->__pyx_kp_b_iso88591_2_wa_WA_q_q_q_1_1_c_1_1_1_1_j_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dataset, __pyx_mstate->__pyx_n_u_scan_options_2, __pyx_mstate->__pyx_n_u_c_scan_options, __pyx_mstate->__pyx_n_u_require_sequenced_output, __pyx_mstate->__pyx_n_u_implicit_ordering};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_set_options, __pyx_mstate->__pyx_kp_b_iso88591_A_1_31IQ_T_2Na_d_HF_t3CC, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 4227};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dataset, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__dataset_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_M_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_WrittenFile, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_haq_7_QnN_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Generator.init */
  if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

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

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    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) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    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_VERSION_HEX < 0x030B0000)
            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 (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    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 (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            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));
            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_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyDictVersioning (used by GetModuleGlobalName) */
#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

/* 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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectCallMethO (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectFastCall (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectCallOneArg (used by ImportImpl) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* GetTopmostException (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == 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 && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif 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;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    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
}
#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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    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;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    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 (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    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;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        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;
      #endif
    }
    #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);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#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 && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif 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

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        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);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    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)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

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

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* RaiseException */
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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        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);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_mstate_global->__pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* PyObjectCall2Args (used by CallUnboundCMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *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)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* 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);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && 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)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    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)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* IterFinish (used by dict_iter) */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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
    __Pyx_TypeName type_name;
    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 defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #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 (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    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;
}
#endif

/* PyObjectCallMethod0 (used by dict_iter) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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;
#endif
}

/* RaiseNeedMoreValuesToUnpack (used by UnpackTuple2) */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack (used by UnpackItemEndCheck) */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck (used by UnpackTuple2) */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* RaiseNoneIterError (used by UnpackTupleError) */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError (used by UnpackTuple2) */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_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_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
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 = __Pyx_PyObject_GetIterNextFunc(iter);
    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 (used by MergeKeywords) */
#if CYTHON_COMPILING_IN_PYPY
#include <string.h>
#endif
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;
#else
        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);
}
#if !CYTHON_AVOID_BORROWED_REFS
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    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);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
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_AVOID_BORROWED_REFS
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        next_item = __Pyx_PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
    } 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;
}

/* MergeKeywords */
static int __Pyx_MergeKeywords_dict(PyObject *kwdict, PyObject *source_dict) {
    Py_ssize_t len1, len2;
    len2 = PyDict_Size(source_dict);
    if (unlikely(len2 == -1)) return -1;
    if (len2 == 0) {
        return 0;
    }
    len1 = PyDict_Size(kwdict);
    if (unlikely(len1 == -1)) return -1;
    if (len1 > 0) {
        PyObject *key, *smaller_dict, *larger_dict;
        #if CYTHON_AVOID_BORROWED_REFS
        PyObject *ppos = NULL;
        #else
        Py_ssize_t ppos = 0;
        #endif
        int duplicates_found = 0;
        if (len1 <= len2) {
            smaller_dict = kwdict;
            larger_dict = source_dict;
        } else {
            smaller_dict = source_dict;
            larger_dict = kwdict;
        }
        __Pyx_BEGIN_CRITICAL_SECTION(smaller_dict);
        while (
            #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            __Pyx_PyDict_NextRef(smaller_dict, &ppos, &key, NULL)
            #else
            PyDict_Next(smaller_dict, &ppos, &key, NULL)
            #endif
        ) {
            if (unlikely(PyDict_Contains(larger_dict, key))) {
                __Pyx_RaiseDoubleKeywordsError("function", key);
                #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
                Py_DECREF(key);
                #endif
                duplicates_found = 1;
                break;
            };
            #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
        __Pyx_END_CRITICAL_SECTION();
        #if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(ppos);
        #endif
        if (unlikely(duplicates_found))
            return -1;
    }
    return PyDict_Update(kwdict, source_dict);
}
static int __Pyx_MergeKeywords_any(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_mstate_global->__pyx_n_u_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                result = __Pyx_MergeKeywords_dict(kwdict, fallback);
                Py_DECREF(fallback);
                return result;
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        {
            int inserted = PyDict_SetDefaultRef(kwdict, key, value, NULL);
            if (unlikely(inserted != 0)) {
                if (inserted == 1) __Pyx_RaiseDoubleKeywordsError("function", key);
                result = -1;
            }
        }
    #else
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
    #endif
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}
static CYTHON_INLINE int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    assert(PyDict_Check(kwdict));
    if (likely(PyDict_Check(source_mapping))) {
        return __Pyx_MergeKeywords_dict(kwdict, source_mapping);
    } else {
        return __Pyx_MergeKeywords_any(kwdict, source_mapping);
    }
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    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;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || 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
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } 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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    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, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* ErrOccurredWithGIL */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  PyGILState_STATE _save = PyGILState_Ensure();
  err = !!PyErr_Occurred();
  PyGILState_Release(_save);
  return err;
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    const char* function_name,
    PyObject *kw)
{
#if CYTHON_COMPILING_IN_PYPY && !defined(PyArg_ValidateKeywordArguments)
    CYTHON_UNUSED_VAR(function_name);
    CYTHON_UNUSED_VAR(kw);
    return 0;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
#if PY_VERSION_HEX >= 0x03090000
        CYTHON_UNUSED_VAR(function_name);
#else
        Py_ssize_t kwsize;
        #if CYTHON_ASSUME_SAFE_SIZE
        kwsize = PyTuple_GET_SIZE(kw);
        #else
        kwsize = PyTuple_Size(kw);
        if (unlikely(kwsize < 0)) return -1;
        #endif
        for (Py_ssize_t pos = 0; pos < kwsize; pos++) {
            PyObject* key = NULL;
            #if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
            #else
            key = PyTuple_GetItem(kw, pos);
            if (unlikely(!key)) return -1;
            #endif
            if (unlikely(!PyUnicode_Check(key))) {
                PyErr_Format(PyExc_TypeError,
                    "%.200s() keywords must be strings", function_name);
                return -1;
            }
        }
#endif
    } else {
        if (unlikely(!PyArg_ValidateKeywordArguments(kw))) return -1;
    }
    return 0;
#endif
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        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));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 0;
    }
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) != 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 1;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 1;
        }
        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));
        return (unequal != 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a != (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(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;
}
#endif
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    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 = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_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, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    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 PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    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);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_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)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (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(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_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;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        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);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            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;
}
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    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);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* tp_new */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __Pyx_tp_new_fallback(PyObject* type_obj, PyObject* args, PyObject* kwargs) {
    PyObject *new_func = NULL, *new_args = NULL, *obj;
    Py_ssize_t i, nargs = PyTuple_Size(args);
    if (unlikely(nargs < 0)) goto bad;
    new_args = PyTuple_New(nargs + 1);
    if (unlikely(!new_args)) goto bad;
    for (i = 0; i < nargs + 1; i++) {
        PyObject *item = (i == 0) ? type_obj : PyTuple_GetItem(args, i - 1);
        if (unlikely(!item)) goto bad;
        Py_INCREF(item);
        if (unlikely(PyTuple_SetItem(new_args, i, item)) < 0) goto bad;
    }
    new_func = PyObject_GetAttrString(type_obj, "__new__");
    if (unlikely(!new_func)) goto bad;
    obj = PyObject_Call(new_func, new_args, kwargs);
    Py_DECREF(new_func);
    Py_DECREF(new_args);
    return obj;
 bad:
    Py_XDECREF(new_func);
    Py_XDECREF(new_args);
    return NULL;
}
#endif
static PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs) {
    newfunc tp_new = __Pyx_PyType_TryGetSlot((PyTypeObject*)type_obj, tp_new, newfunc);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    if (!tp_new) return __Pyx_tp_new_fallback(type_obj, args, kwargs);
#else
    assert(tp_new != NULL);
#endif
    return tp_new((PyTypeObject*)type_obj, args, kwargs);
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        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 value;
}
#endif

/* CallNextTpDealloc */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
    PyTypeObject* type = Py_TYPE(obj);
    destructor tp_dealloc = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type)
        tp_dealloc(obj);
}

/* CallNextTpTraverse */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    traverseproc tp_traverse = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type && tp_traverse)
        return 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);
    inquiry tp_clear = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type && tp_clear)
        tp_clear(obj);
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* FunctionExport */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) {
    PyObject *cobj;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(api_dict, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(cobj);
    return -1;
}

/* GetApiDict */
static PyObject *__Pyx_ApiExport_GetApiDict(void) {
    PyObject *d;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        return NULL;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    return d;
bad:
    Py_XDECREF(d);
    return NULL;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_4
#define __PYX_HAVE_RT_ImportType_3_2_4
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#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;
    }
#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    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;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < 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+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_4 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_4 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* ValidateBasesTuple (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* PxdImportShared (used by VoidPtrImport) */
#ifndef __PYX_HAVE_RT_ImportFromPxd_3_2_4
#define __PYX_HAVE_RT_ImportFromPxd_3_2_4
static int __Pyx_ImportFromPxd_3_2_4(PyObject *module, const char *name, void **p, const char *sig, const char *what) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    d = PyObject_GetAttrString(module, "__pyx_capi__");
    if (!d)
        goto bad;
#if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
    PyDict_GetItemStringRef(d, name, &cobj);
#else
    cobj = PyDict_GetItemString(d, name);
    Py_XINCREF(cobj);
#endif
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C %.8s %.200s",
                PyModule_GetName(module), what, name);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C %.8s %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             what, PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(d);
    Py_XDECREF(cobj);
    return -1;
}
#endif

/* VoidPtrImport */
#ifndef __PYX_HAVE_RT_ImportVoidPtr_3_2_4
#define __PYX_HAVE_RT_ImportVoidPtr_3_2_4
static int __Pyx_ImportVoidPtr_3_2_4(PyObject *module, const char *name, void **p, const char *sig) {
    return __Pyx_ImportFromPxd_3_2_4(module, name, p, sig, "variable");
}
#endif

/* FunctionImport */
#ifndef __PYX_HAVE_RT_ImportFunction_3_2_4
#define __PYX_HAVE_RT_ImportFunction_3_2_4
static int __Pyx_ImportFunction_3_2_4(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    int result = __Pyx_ImportFromPxd_3_2_4(module, funcname, &tmp.p, sig, "function");
    if (result == 0) {
        *f = tmp.fp;
    }
    return result;
}
#endif

/* 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_PYPY
    if (PyMethodDescr_Check(method))
#else
    if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
        PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(method));
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* ListPack */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
    va_list va;
    PyObject *l = PyList_New(n);
    va_start(va, n);
    if (unlikely(!l)) goto end;
    for (Py_ssize_t i=0; i<n; ++i) {
        PyObject *arg = va_arg(va, PyObject*);
        Py_INCREF(arg);
        if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
            Py_CLEAR(l);
            goto end;
        }
    }
    end:
    va_end(va);
    return l;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        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) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectLookupSpecial (used by Py3ClassCreate) */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    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 if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* 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_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_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;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_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;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    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) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__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);
}
#endif

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

/* CheckUnpickleChecksum */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    PyObject *pickle_module = PyImport_ImportModule("pickle");
    if (unlikely(!pickle_module)) return;
    PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
    Py_DECREF(pickle_module);
    if (unlikely(!pickle_error)) return;
    if (checksum2 == checksum1) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
            checksum, checksum1, members);
    } else if (checksum3 == checksum2) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, members);
    } else {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, checksum3, members);
    }
    Py_DECREF(pickle_error);
}
static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    int found = 0;
    found |= checksum1 == checksum;
    found |= checksum2 == checksum;
    found |= checksum3 == checksum;
    if (likely(found))
        return 0;
    __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
    return -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyLong_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int64_t) -1;
        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 int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyLong_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        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;
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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);
#endif
}

/* UpdateUnpickledDict */
static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
    if (unlikely(!state_dict)) {
        return -1;
    }
    int non_empty = PyObject_IsTrue(state_dict);
    if (non_empty == 0) {
        Py_DECREF(state_dict);
        return 0;
    } else if (unlikely(non_empty == -1)) {
        return -1;
    }
    PyObject *dict;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = PyObject_GetAttrString(obj, "__dict__");
    #else
    dict = PyObject_GenericGetDict(obj, NULL);
    #endif
    if (unlikely(!dict)) {
        Py_DECREF(state_dict);
        return -1;
    }
    int result;
    if (likely(PyDict_CheckExact(dict))) {
        result = PyDict_Update(dict, state_dict);
    } else {
        PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
        if (likely(obj_result)) {
            Py_DECREF(obj_result);
            result = 0;
        } else {
            result = -1;
        }
    }
    Py_DECREF(state_dict);
    Py_DECREF(dict);
    return result;
}
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(state_size == -1)) return -1;
    #endif
    if (state_size <= index) {
        return 0;
    }
    return __Pyx__UpdateUnpickledDict(obj, state, index);
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__56);
    }
    goto done;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        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);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        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

/* GetRuntimeVersion */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
void __Pyx_init_runtime_version(void) {
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
}
#endif
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    return __Pyx_cached_runtime_version;
#endif
}

/* IterNextPlain (used by CoroutineBase) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* ReturnWithStopIteration (used by CoroutineBase) */
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase (used by Generator) */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __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;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#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 CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    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);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    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);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(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(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#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_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #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
    retval = self->body(self, tstate, value);
#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
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #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
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    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);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        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)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
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;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        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)
                goto propagate_exception;
            goto throw_here;
        }
        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_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "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) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    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);
    __Pyx_Coroutine_Undelegate(gen);
    __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_frame);
    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 PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    if (gen->gi_weakreflist != NULL)
    #endif
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 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);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
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;
    }
    __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 (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_BEGIN_CRITICAL_SECTION(self);
    #endif
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    #if PY_VERSION_HEX >= 0x030d0000
    Py_END_CRITICAL_SECTION();
    #endif
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
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->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_weakreflist = NULL;
#endif
    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;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    gen->is_running = 1;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    assert(gen->is_running);
    gen->is_running = 0;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     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,
     PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being iterated by 'yield from', or None")},
    {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the generator"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the generator"), 0},
    {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the generator"), 0},
    {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_WEAKREF |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_GeneratorType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
#endif
static int __pyx_Generator_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
    if (unlikely(!mstate->__pyx_GeneratorType)) {
        return -1;
    }
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
#endif
    return 0;
}
static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *retval = NULL;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    __Pyx_Coroutine_unset_is_running(gen);
    (void) result;
    assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
    assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
    return retval;
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, 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
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
    PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) goto bad;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
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_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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 = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
