|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +import _cython_3_0_11 |
| 19 | +import nanoarrow._device |
| 20 | +from _typeshed import Incomplete |
| 21 | +from nanoarrow._device import DeviceType as DeviceType |
| 22 | +from typing import ClassVar |
| 23 | + |
| 24 | +DEVICE_CPU: nanoarrow._device.Device |
| 25 | +__reduce_cython__: _cython_3_0_11.cython_function_or_method |
| 26 | +__setstate_cython__: _cython_3_0_11.cython_function_or_method |
| 27 | +__test__: dict |
| 28 | + |
| 29 | +class CArray: |
| 30 | + __pyx_vtable__: ClassVar[PyCapsule] = ... |
| 31 | + buffers: Incomplete |
| 32 | + children: Incomplete |
| 33 | + device_id: Incomplete |
| 34 | + device_type: Incomplete |
| 35 | + device_type_id: Incomplete |
| 36 | + dictionary: Incomplete |
| 37 | + length: Incomplete |
| 38 | + n_buffers: Incomplete |
| 39 | + n_children: Incomplete |
| 40 | + null_count: Incomplete |
| 41 | + offset: Incomplete |
| 42 | + schema: Incomplete |
| 43 | + @classmethod |
| 44 | + def __init__(cls, *args, **kwargs) -> None: |
| 45 | + """Create and return a new object. See help(type) for accurate signature.""" |
| 46 | + @staticmethod |
| 47 | + def allocate(*args, **kwargs): |
| 48 | + """Allocate a released ArrowArray""" |
| 49 | + def child(self, *args, **kwargs): ... |
| 50 | + def is_valid(self, *args, **kwargs): |
| 51 | + """Check for a non-null and non-released underlying ArrowArray""" |
| 52 | + def view(self, *args, **kwargs): |
| 53 | + """Allocate a :class:`CArrayView` to access the buffers of this array""" |
| 54 | + def __arrow_c_array__(self, *args, **kwargs): |
| 55 | + """ |
| 56 | + Get a pair of PyCapsules containing a C ArrowArray representation of the object. |
| 57 | +
|
| 58 | + Parameters |
| 59 | + ---------- |
| 60 | + requested_schema : PyCapsule | None |
| 61 | + A PyCapsule containing a C ArrowSchema representation of a requested |
| 62 | + schema. Not supported. |
| 63 | +
|
| 64 | + Returns |
| 65 | + ------- |
| 66 | + Tuple[PyCapsule, PyCapsule] |
| 67 | + A pair of PyCapsules containing a C ArrowSchema and ArrowArray, |
| 68 | + respectively. |
| 69 | + """ |
| 70 | + def __getitem__(self, index): |
| 71 | + """Return self[key].""" |
| 72 | + def __len__(self) -> int: |
| 73 | + """Return len(self).""" |
| 74 | + def __reduce__(self): ... |
| 75 | + |
| 76 | +class CArrayBuilder: |
| 77 | + @classmethod |
| 78 | + def __init__(cls, *args, **kwargs) -> None: |
| 79 | + """Create and return a new object. See help(type) for accurate signature.""" |
| 80 | + @staticmethod |
| 81 | + def allocate(*args, **kwargs): |
| 82 | + """Create a CArrayBuilder |
| 83 | +
|
| 84 | + Allocates memory for an ArrowArray and populates it with nanoarrow's |
| 85 | + ArrowArray private_data/release callback implementation. This should |
| 86 | + usually be followed by :meth:`init_from_type` or :meth:`init_from_schema`. |
| 87 | + """ |
| 88 | + def append_bytes(self, *args, **kwargs): ... |
| 89 | + def append_strings(self, *args, **kwargs): ... |
| 90 | + def finish(self, *args, **kwargs): |
| 91 | + """Finish building this array |
| 92 | +
|
| 93 | + Performs any steps required to return a valid ArrowArray and optionally |
| 94 | + validates the output to ensure that the result is valid (given the information |
| 95 | + the array has available to it). |
| 96 | +
|
| 97 | + Parameters |
| 98 | + ---------- |
| 99 | + validation_level : None, "full", "default", "minimal", or "none", optional |
| 100 | + Explicitly define a validation level or use None to perform default |
| 101 | + validation if possible. Validation may not be possible if children |
| 102 | + were set that were not created by nanoarrow. |
| 103 | + """ |
| 104 | + def finish_device(self, *args, **kwargs): |
| 105 | + """Finish building this array and export to an ArrowDeviceArray |
| 106 | +
|
| 107 | + Calls :meth:`finish`, propagating device information into an ArrowDeviceArray. |
| 108 | + """ |
| 109 | + def init_from_schema(self, *args, **kwargs): ... |
| 110 | + def init_from_type(self, *args, **kwargs): ... |
| 111 | + def is_empty(self, *args, **kwargs): |
| 112 | + """Check if any items have been appended to this builder""" |
| 113 | + def resolve_null_count(self, *args, **kwargs): |
| 114 | + """Ensure the output null count is synchronized with existing buffers |
| 115 | +
|
| 116 | + Note that this will not attempt to access non-CPU buffers such that |
| 117 | + :attr:`null_count` might still be -1 after calling this method. |
| 118 | + """ |
| 119 | + def set_buffer(self, *args, **kwargs): |
| 120 | + """Set an ArrowArray buffer |
| 121 | +
|
| 122 | + Sets a buffer of this ArrowArray such the pointer at array->buffers[i] is |
| 123 | + equal to buffer->data and such that the buffer's lifcycle is managed by |
| 124 | + the array. If move is True, the input Python object that previously wrapped |
| 125 | + the ArrowBuffer will be invalidated, which is usually the desired behaviour |
| 126 | + if you built or imported a buffer specifically to build this array. If move |
| 127 | + is False (the default), this function will a make a shallow copy via another |
| 128 | + layer of Python object wrapping. |
| 129 | + """ |
| 130 | + def set_child(self, *args, **kwargs): |
| 131 | + """Set an ArrowArray child |
| 132 | +
|
| 133 | + Set a child of this array by performing a show copy or optionally |
| 134 | + transferring ownership to this object. The initialized child array |
| 135 | + must have been initialized before this call by initializing this |
| 136 | + builder with a schema containing the correct number of children. |
| 137 | + """ |
| 138 | + def set_length(self, *args, **kwargs): ... |
| 139 | + def set_null_count(self, *args, **kwargs): ... |
| 140 | + def set_offset(self, *args, **kwargs): ... |
| 141 | + def start_appending(self, *args, **kwargs): |
| 142 | + """Use append mode for building this ArrowArray |
| 143 | +
|
| 144 | + Calling this method is required to produce a valid array prior to calling |
| 145 | + :meth:`append_strings` or `append_bytes`. |
| 146 | + """ |
| 147 | + def __reduce__(self): ... |
| 148 | + |
| 149 | +class CArrayView: |
| 150 | + buffers: Incomplete |
| 151 | + children: Incomplete |
| 152 | + dictionary: Incomplete |
| 153 | + layout: Incomplete |
| 154 | + length: Incomplete |
| 155 | + n_buffers: Incomplete |
| 156 | + n_children: Incomplete |
| 157 | + null_count: Incomplete |
| 158 | + offset: Incomplete |
| 159 | + storage_type: Incomplete |
| 160 | + storage_type_id: Incomplete |
| 161 | + @classmethod |
| 162 | + def __init__(cls, *args, **kwargs) -> None: |
| 163 | + """Create and return a new object. See help(type) for accurate signature.""" |
| 164 | + def buffer(self, *args, **kwargs): ... |
| 165 | + def buffer_type(self, *args, **kwargs): ... |
| 166 | + def child(self, *args, **kwargs): ... |
| 167 | + @staticmethod |
| 168 | + def from_array(*args, **kwargs): ... |
| 169 | + @staticmethod |
| 170 | + def from_schema(*args, **kwargs): ... |
| 171 | + def __len__(self) -> int: |
| 172 | + """Return len(self).""" |
| 173 | + def __reduce__(self): ... |
| 174 | + |
| 175 | +class CDeviceArray: |
| 176 | + array: Incomplete |
| 177 | + device_id: Incomplete |
| 178 | + device_type: Incomplete |
| 179 | + device_type_id: Incomplete |
| 180 | + schema: Incomplete |
| 181 | + @classmethod |
| 182 | + def __init__(cls, *args, **kwargs) -> None: |
| 183 | + """Create and return a new object. See help(type) for accurate signature.""" |
| 184 | + def view(self, *args, **kwargs): ... |
| 185 | + def __arrow_c_array__(self, *args, **kwargs): ... |
| 186 | + def __arrow_c_device_array__(self, *args, **kwargs): ... |
| 187 | + def __reduce__(self): ... |
0 commit comments