Generated by Cython 3.3.0
Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.
Raw output: dataframe.pxi
0001: # See: dataframe.md for technical overview.
0002:
+0003: from decimal import Decimal
{
PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Decimal};
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_decimal, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
}
__pyx_t_4 = __pyx_t_1;
__Pyx_GOTREF(__pyx_t_4);
{
PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Decimal};
__pyx_t_9 = 0; {
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_9], __pyx_t_5) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0004: import sys
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_4) < (0)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0005: import uuid as _uuid
__pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_uuid, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __pyx_t_4 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_uuid_2, __pyx_t_4) < (0)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
0006:
0007: from cpython.bytes cimport PyBytes_AsString
0008: from .mpdecimal_compat cimport decimal_pyobj_to_binary
0009:
0010: # `decimal_pyobj_to_binary` reinterprets a Decimal's memory with the struct
0011: # layout of CPython's `_decimal` accelerator, without checking that it is
0012: # looking at one. Reading any other interpreter's Decimal that way is
0013: # undefined behaviour, so the layout has to be established first.
0014: #
0015: # The interpreter is checked as well as the module. `Decimal is
0016: # _decimal.Decimal` only says that the `decimal` module is backed by
0017: # something named `_decimal`, which is true on other interpreters that ship
0018: # their own `_decimal` under the same name and a different shape -- so on
0019: # its own it admits exactly the case it is meant to exclude.
+0020: cdef str _PY_IMPL_NAME = sys.implementation.name
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_implementation); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(2, 20, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PY_IMPL_NAME); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PY_IMPL_NAME, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0;
0021: cdef bint _DECIMAL_IS_C
+0022: if _PY_IMPL_NAME == 'cpython':
__pyx_t_8 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_7questdb_7_client__PY_IMPL_NAME, __pyx_mstate_global->__pyx_n_u_cpython, Py_EQ); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(2, 22, __pyx_L1_error) if (__pyx_t_8) { /* … */ goto __pyx_L35; }
+0023: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L41_try_end;
__pyx_L36_error:;
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__pyx_L38_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_L37_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
__pyx_L41_try_end:;
}
+0024: import _decimal as _decimal_accel
__pyx_t_10 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_decimal_2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 24, __pyx_L36_error) __pyx_t_4 = __pyx_t_10; __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_decimal_accel, __pyx_t_4) < (0)) __PYX_ERR(2, 24, __pyx_L36_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0025: _DECIMAL_IS_C = Decimal is getattr(_decimal_accel, 'Decimal', None)
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 25, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_decimal_accel); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 25, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_GetAttr3(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Decimal, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 25, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__pyx_t_4 == __pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_7questdb_7_client__DECIMAL_IS_C = __pyx_t_8;
+0026: except ImportError:
__pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_12) { __Pyx_ErrRestore(0,0,0);
+0027: _DECIMAL_IS_C = False
__pyx_v_7questdb_7_client__DECIMAL_IS_C = 0;
goto __pyx_L37_exception_handled;
}
goto __pyx_L38_except_error;
0028: else:
+0029: _DECIMAL_IS_C = False
/*else*/ {
__pyx_v_7questdb_7_client__DECIMAL_IS_C = 0;
}
__pyx_L35:;
0030:
0031:
0032: # The type object behind `decimal.Decimal`, for reading an object's real
0033: # type through `Py_TYPE` rather than its `__class__`.
+0034: cdef PyTypeObject* _DECIMAL_C_TYPE = <PyTypeObject*><PyObject*>Decimal
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Decimal); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_v_7questdb_7_client__DECIMAL_C_TYPE = ((PyTypeObject *)((PyObject *)__pyx_t_11)); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
0035:
0036:
+0037: cdef inline bint _is_decimal(object value) noexcept:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__is_decimal(PyObject *__pyx_v_value) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0038: """Whether `value` really is a `decimal.Decimal`.
0039:
0040: `isinstance` asks the object for its `__class__`, which any object
0041: can set to whatever it likes, and `decimal_pyobj_to_binary` goes on
0042: to read the object's raw memory with CPython's `Decimal` struct
0043: layout: it takes `mpd.len` limbs from the `mpd.data` pointer it
0044: finds there. An object that merely claims to be a `Decimal` sends it
0045: walking unrelated heap memory, which reaches the wire as a bogus
0046: value or takes the interpreter down with a segfault. `Py_TYPE` is
0047: the object's real type and nothing can forge it.
0048:
0049: A genuine `Decimal` subclass still passes. A subclass lays its own
0050: fields after the base struct, so the fields read here stay at the
0051: offsets the layout expects.
0052: """
+0053: return PyObject_TypeCheck(value, _DECIMAL_C_TYPE)
{
__pyx_r = PyObject_TypeCheck(__pyx_v_value, __pyx_v_7questdb_7_client__DECIMAL_C_TYPE);
}
goto __pyx_L0;
0054:
0055:
0056: # Auto-flush settings.
0057: # The individual `interval`, `row_count` and `byte_count`
0058: # settings are set to `-1` when disabled.
0059: # If `.enabled`, then at least one of the settings are `!= -1`.
+0060: cdef struct auto_flush_mode_t:
struct __pyx_t_7questdb_7_client_auto_flush_mode_t {
int enabled;
int64_t interval;
int64_t row_count;
int64_t byte_count;
};
0061: bint enabled
0062: int64_t interval
0063: int64_t row_count
0064: int64_t byte_count
0065:
0066:
+0067: cdef struct auto_flush_t:
struct __pyx_t_7questdb_7_client_auto_flush_t {
struct line_sender **sender_slot;
struct __pyx_t_7questdb_7_client_auto_flush_mode_t mode;
int64_t *last_flush_ms;
};
0068: # The sender's own `_impl` field, not a copy of what was in it. A
0069: # frame's plan build and its cells run the caller's Python, and a
0070: # `close()` arriving from there frees the sender and leaves the
0071: # field NULL -- which the auto-flush below already reads as "no
0072: # sender, nothing to flush". A copy taken before the run would
0073: # instead be a freed pointer handed to `line_sender_flush`.
0074: line_sender** sender_slot
0075: auto_flush_mode_t mode
0076: int64_t* last_flush_ms
0077:
0078:
+0079: cdef auto_flush_t auto_flush_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_f_7questdb_7_client_auto_flush_blank(void) {
struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_v_af;
struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0080: cdef auto_flush_t af
+0081: af.sender_slot = NULL
__pyx_v_af.sender_slot = NULL;
+0082: af.mode.enabled = False
__pyx_v_af.mode.enabled = 0;
+0083: af.mode.interval = -1
__pyx_v_af.mode.interval = -1L;
+0084: af.mode.row_count = -1
__pyx_v_af.mode.row_count = -1L;
+0085: af.mode.byte_count = -1
__pyx_v_af.mode.byte_count = -1L;
+0086: af.last_flush_ms = NULL
__pyx_v_af.last_flush_ms = NULL;
+0087: return af
{
__pyx_r = __pyx_v_af;
}
goto __pyx_L0;
0088:
+0089: cdef bint should_auto_flush(
static int __pyx_f_7questdb_7_client_should_auto_flush(struct __pyx_t_7questdb_7_client_auto_flush_mode_t const *__pyx_v_af_mode, struct line_sender_buffer *__pyx_v_ls_buf, int64_t __pyx_v_last_flush_ms) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0090: const auto_flush_mode_t* af_mode,
0091: line_sender_buffer* ls_buf,
0092: int64_t last_flush_ms):
+0093: if not af_mode.enabled:
__pyx_t_1 = (!(__pyx_v_af_mode->enabled != 0));
if (__pyx_t_1) {
/* … */
}
+0094: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
0095:
0096: # Check `auto_flush_rows` breach.
+0097: if (af_mode.row_count != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->row_count != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0098: (<int64_t>line_sender_buffer_row_count(ls_buf) >= af_mode.row_count):
__pyx_t_2 = (((int64_t)line_sender_buffer_row_count(__pyx_v_ls_buf)) >= __pyx_v_af_mode->row_count); __pyx_t_1 = __pyx_t_2; __pyx_L5_bool_binop_done:;
+0099: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
0100:
0101: # Check `auto_flush_bytes` breach.
+0102: if (af_mode.byte_count != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->byte_count != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L8_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0103: (<int64_t>line_sender_buffer_size(ls_buf) >= af_mode.byte_count):
__pyx_t_2 = (((int64_t)line_sender_buffer_size(__pyx_v_ls_buf)) >= __pyx_v_af_mode->byte_count); __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:;
+0104: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
0105:
0106: # Check for interval breach.
+0107: if (af_mode.interval != -1) and \
__pyx_t_2 = (__pyx_v_af_mode->interval != -1L);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L11_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+0108: (((line_sender_now_micros() / 1000) - last_flush_ms) >= af_mode.interval):
__pyx_t_2 = (((((double)line_sender_now_micros()) / 1000.0) - __pyx_v_last_flush_ms) >= __pyx_v_af_mode->interval); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:;
+0109: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
0110:
+0111: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
0112:
+0113: cdef inline uint32_t bswap32(uint32_t value) noexcept:
static CYTHON_INLINE uint32_t __pyx_f_7questdb_7_client_bswap32(uint32_t __pyx_v_value) {
uint32_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0114: return (((value & 0xFF000000u) >> 24u) |
0115: ((value & 0x00FF0000u) >> 8u) |
+0116: ((value & 0x0000FF00u) << 8u) |
{
__pyx_r = (((((__pyx_v_value & 0xFF000000U) >> 24U) | ((__pyx_v_value & 0x00FF0000U) >> 8U)) | ((__pyx_v_value & 0x0000FF00U) << 8U)) | ((__pyx_v_value & 0x000000FFU) << 24U));
}
goto __pyx_L0;
0117: ((value & 0x000000FFu) << 24u))
0118:
+0119: cdef inline uint64_t bswap64(uint64_t value) noexcept:
static CYTHON_INLINE uint64_t __pyx_f_7questdb_7_client_bswap64(uint64_t __pyx_v_value) {
uint64_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0120: return (((value & 0xFF00000000000000u) >> 56u) |
0121: ((value & 0x00FF000000000000u) >> 40u) |
0122: ((value & 0x0000FF0000000000u) >> 24u) |
0123: ((value & 0x000000FF00000000u) >> 8u) |
0124: ((value & 0x00000000FF000000u) << 8u) |
0125: ((value & 0x0000000000FF0000u) << 24u) |
+0126: ((value & 0x000000000000FF00u) << 40u) |
{
__pyx_r = (((((((((__pyx_v_value & 0xFF00000000000000U) >> 56U) | ((__pyx_v_value & 0x00FF000000000000U) >> 40U)) | ((__pyx_v_value & 0x0000FF0000000000U) >> 24U)) | ((__pyx_v_value & 0x000000FF00000000U) >> 8U)) | ((__pyx_v_value & 0x00000000FF000000U) << 8U)) | ((__pyx_v_value & 0x0000000000FF0000U) << 24U)) | ((__pyx_v_value & 0x000000000000FF00U) << 40U)) | ((__pyx_v_value & 0x00000000000000FFU) << 56U));
}
goto __pyx_L0;
0127: ((value & 0x00000000000000FFu) << 56u))
0128:
0129: # Bound once at import. The test below runs per cell in the DataFrame
0130: # IPV4 builder and per column value in `Buffer.row`, where reaching
0131: # through the module for each of the two classes is the whole cost.
+0132: cdef object _IPV4_ADDRESS = ipaddress.IPv4Address
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_IPv4Address); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__IPV4_ADDRESS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__IPV4_ADDRESS, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0;
+0133: cdef object _IPV4_INTERFACE = ipaddress.IPv4Interface
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_IPv4Interface); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__IPV4_INTERFACE); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__IPV4_INTERFACE, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0;
+0134: cdef object _IPV6_ADDRESS = ipaddress.IPv6Address
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ipaddress); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_IPv6Address); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__IPV6_ADDRESS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__IPV6_ADDRESS, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0;
+0135: cdef object _UUID = _uuid.UUID
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_uuid_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UUID); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__UUID); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__UUID, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0;
0136:
0137: # `int.to_bytes`, unbound so a subclass cannot narrow the result. The
0138: # row path uses it per UUID cell, where reaching through `int` for it
0139: # each time is the whole cost.
+0140: cdef object _INT_TO_BYTES = int.to_bytes
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyLong_Type)), __pyx_mstate_global->__pyx_n_u_to_bytes); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__INT_TO_BYTES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__INT_TO_BYTES, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0;
0141:
0142:
0143: # Why an `IPv4Interface` is refused, worded once for the three places
0144: # that refuse one. `IPv4Interface` subclasses `IPv4Address`, so any
0145: # message listing the accepted types reads as a contradiction on its
0146: # own: it names the parent of the thing it has just turned away, and
0147: # says nothing about the prefix that is the actual reason. Each caller
0148: # adds the remedy its own shape calls for.
+0149: cdef str _IPV4_INTERFACE_REASON = (
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_ipaddress_IPv4Interface_carries); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__IPV4_INTERFACE_REASON); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__IPV4_INTERFACE_REASON, __pyx_mstate_global->__pyx_kp_u_ipaddress_IPv4Interface_carries); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_ipaddress_IPv4Interface_carries);
0150: 'ipaddress.IPv4Interface carries a network prefix, which a QuestDB '
0151: 'IPV4 column has nowhere to keep.')
0152:
0153:
+0154: cdef str _ipv4_interface_df_message(object df_col_name):
static PyObject *__pyx_f_7questdb_7_client__ipv4_interface_df_message(PyObject *__pyx_v_df_col_name) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._ipv4_interface_df_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0155: """The DataFrame-path refusal for an ``IPv4Interface`` cell, naming
0156: a remedy that works on a whole column."""
0157: return (
0158: _IPV4_INTERFACE_REASON
+0159: + f' Pass the addresses instead, e.g. df[{df_col_name!r}] = '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_df_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_Pass_the_addresses_instead_e_g; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__12; __pyx_t_3 = 41; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_7questdb_7_client__IPV4_INTERFACE_REASON, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0160: + f'df[{df_col_name!r}].map(lambda value: value.ip).')
__pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_df_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_df; __pyx_t_2[1] = __pyx_t_5; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_map_lambda_value_value_ip; __pyx_t_3 = 33; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_5); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_5 = 0; goto __pyx_L0;
0161:
0162:
+0163: cdef inline bint _is_ipv4_address(object value):
static CYTHON_INLINE int __pyx_f_7questdb_7_client__is_ipv4_address(PyObject *__pyx_v_value) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._is_ipv4_address", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0164: """``IPv4Interface`` subclasses ``IPv4Address`` but carries a network
0165: prefix that QuestDB's IPV4 column has nowhere to keep, so it is not
0166: accepted as an address. Every other subclass is."""
0167: # An exact `IPv4Address` is the overwhelmingly common cell and
0168: # settles both questions at once: it is an address, and it is not
0169: # the interface subclass.
+0170: if type(value) is _IPV4_ADDRESS:
__pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_value)) == __pyx_v_7questdb_7_client__IPV4_ADDRESS);
if (__pyx_t_1) {
/* … */
}
+0171: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
+0172: return (isinstance(value, _IPV4_ADDRESS)
__pyx_t_2 = __pyx_v_7questdb_7_client__IPV4_ADDRESS; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; }
+0173: and not isinstance(value, _IPV4_INTERFACE))
__pyx_t_2 = __pyx_v_7questdb_7_client__IPV4_INTERFACE; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (!__pyx_t_3); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; { __pyx_r = __pyx_t_1; } goto __pyx_L0;
0174:
0175:
+0176: cdef struct col_chunks_t:
struct __pyx_t_7questdb_7_client_col_chunks_t {
size_t n_chunks;
struct ArrowArray *chunks;
};
0177: size_t n_chunks
0178: ArrowArray* chunks # We calloc `n_chunks + 1` of these.
0179:
0180:
+0181: cdef struct col_cursor_t:
struct __pyx_t_7questdb_7_client_col_cursor_t {
struct ArrowArray *chunk;
size_t chunk_index;
size_t offset;
int dictionary_large_offsets;
};
0182: ArrowArray* chunk # Current chunk.
0183: size_t chunk_index
0184: size_t offset # i.e. the element index (not byte offset)
0185: bint dictionary_large_offsets
0186:
0187:
+0188: cdef enum col_target_t:
enum __pyx_t_7questdb_7_client_col_target_t {
__pyx_e_7questdb_7_client_col_target_skip = 0,
__pyx_e_7questdb_7_client_col_target_table = 1,
__pyx_e_7questdb_7_client_col_target_symbol = 2,
__pyx_e_7questdb_7_client_col_target_column_bool = 3,
__pyx_e_7questdb_7_client_col_target_column_i64 = 4,
__pyx_e_7questdb_7_client_col_target_column_f64 = 5,
__pyx_e_7questdb_7_client_col_target_column_str = 6,
__pyx_e_7questdb_7_client_col_target_column_ts = 7,
__pyx_e_7questdb_7_client_col_target_column_arr_f64 = 8,
__pyx_e_7questdb_7_client_col_target_column_decimal = 9,
__pyx_e_7questdb_7_client_col_target_at = 10,
__pyx_e_7questdb_7_client_col_target_column_i8 = 11,
__pyx_e_7questdb_7_client_col_target_column_i16 = 12,
__pyx_e_7questdb_7_client_col_target_column_i32 = 13,
__pyx_e_7questdb_7_client_col_target_column_f32 = 14,
__pyx_e_7questdb_7_client_col_target_column_uuid = 15,
__pyx_e_7questdb_7_client_col_target_column_long256 = 16,
__pyx_e_7questdb_7_client_col_target_column_ipv4 = 17,
__pyx_e_7questdb_7_client_col_target_column_binary = 18,
__pyx_e_7questdb_7_client_col_target_column_arrow = 19
};
0189: col_target_skip = 0
0190: col_target_table = 1
0191: col_target_symbol = 2
0192: col_target_column_bool = 3
0193: col_target_column_i64 = 4
0194: col_target_column_f64 = 5
0195: col_target_column_str = 6
0196: col_target_column_ts = 7
0197: col_target_column_arr_f64 = 8
0198: col_target_column_decimal = 9
0199: col_target_at = 10
0200: # Narrow numeric targets used by the column-QWP path only. Each
0201: # maps to a dedicated wire type (BYTE / SHORT / INT / FLOAT)
0202: # instead of widening to LONG / DOUBLE. Selected by
0203: # `_FIELD_TARGETS_QWP`, which puts these ahead of the wide
0204: # targets so the resolver picks them for Arrow narrow sources;
0205: # row-ILP uses `_FIELD_TARGETS_ROW`, which does not list them.
0206: col_target_column_i8 = 11
0207: col_target_column_i16 = 12
0208: col_target_column_i32 = 13
0209: col_target_column_f32 = 14
0210: col_target_column_uuid = 15
0211: # Reserved. No source resolves to it: LONG256 on the Arrow columnar
0212: # path is claimed by field metadata or `schema_overrides` and goes
0213: # out through `col_target_column_arrow`, and on the NumPy planner a
0214: # `long256` round-trip claim rides on `col_target_column_i64` with a
0215: # `qwp_numpy_s32` override. Re-listing it means giving it an entry in
0216: # `_TARGET_TO_SOURCES` as well, which is otherwise indexed unguarded.
0217: col_target_column_long256 = 16
0218: col_target_column_ipv4 = 17
0219: col_target_column_binary = 18
0220: # Generic Arrow field passthrough to the Rust importer; column-QWP only.
0221: col_target_column_arrow = 19
0222:
0223:
0224: # The version stamped into `df.attrs['questdb']` by the egress and
0225: # required by the two ingest-side readers. Bump it only when the claim
0226: # vocabulary changes in a way an older client would misread.
+0227: cdef int _ROUNDTRIP_META_VERSION = 1
__pyx_v_7questdb_7_client__ROUNDTRIP_META_VERSION = 1;
0228:
0229:
+0230: cdef object _plain_mapping(object value):
static PyObject *__pyx_f_7questdb_7_client__plain_mapping(PyObject *__pyx_v_value) {
PyObject *__pyx_7genexpr__pyx_v_key = NULL;
PyObject *__pyx_7genexpr__pyx_v_item = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._plain_mapping", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_key);
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_item);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0231: """`value` with every mapping in it, at every depth, a plain `dict`."""
+0232: if isinstance(value, dict):
__pyx_t_1 = PyDict_Check(__pyx_v_value);
if (__pyx_t_1) {
/* … */
}
+0233: return {key: _plain_mapping(item) for key, item in value.items()}
{ /* enter inner scope */
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = 0;
if (unlikely(__pyx_v_value == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 233, __pyx_L6_error)
}
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_value, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 233, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_3);
__pyx_t_3 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 233, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_key, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_item, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_t_8 = __pyx_f_7questdb_7_client__plain_mapping(__pyx_7genexpr__pyx_v_item); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 233, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_8);
if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_7genexpr__pyx_v_key, __pyx_t_8))) __PYX_ERR(2, 233, __pyx_L6_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_item); __pyx_7genexpr__pyx_v_item = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_key); __pyx_7genexpr__pyx_v_key = 0;
goto __pyx_L9_exit_scope;
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_item); __pyx_7genexpr__pyx_v_item = 0;
__Pyx_XDECREF(__pyx_7genexpr__pyx_v_key); __pyx_7genexpr__pyx_v_key = 0;
goto __pyx_L1_error;
__pyx_L9_exit_scope:;
} /* exit inner scope */
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = __pyx_t_2;
}
__Pyx_XDECREF(__pyx_temp);
}
__pyx_t_2 = 0;
goto __pyx_L0;
+0234: return value
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_value);
__pyx_r = __pyx_v_value;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0235:
0236:
+0237: class _RoundtripClaim(dict):
{
PyObject* __pyx_temp[1] = {((PyObject *)(&PyDict_Type))};
__pyx_t_11 = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_13 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_RoundtripClaim, __pyx_mstate_global->__pyx_n_u_RoundtripClaim, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_kp_u_The_df_attrs_questdb_payload_a_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
if (__pyx_t_4 != __pyx_t_11) {
if (unlikely((PyDict_SetItemString(__pyx_t_13, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(2, 237, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* … */
__pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RoundtripClaim, __pyx_t_4, __pyx_t_13, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RoundtripClaim, __pyx_t_11) < (0)) __PYX_ERR(2, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
0238: """The ``df.attrs['questdb']`` payload: a ``dict`` that declines to
0239: be copied.
0240:
0241: pandas deep-copies the whole of ``attrs`` every time it propagates
0242: it -- ``NDFrame.__finalize__`` does ``self.attrs =
0243: deepcopy(other.attrs)`` -- and that runs once per column while a
0244: frame is being exported or sliced. With a per-column claim the copy
0245: is itself the size of the frame, so the pass is quadratic in the
0246: column count: ``pyarrow.table(df)`` on a 1024-column frame spends
0247: 710 ms of its 730 ms inside ``copy.deepcopy``, against 26 ms once
0248: the claim declines to copy and 23 ms for the same frame carrying no
0249: claim at all. Most of those copies are pandas' own -- its Arrow
0250: export reads the frame a column at a time -- so the claim has to be
0251: cheap to copy wherever the frame goes, not only inside this client.
0252:
0253: Declining to copy is sound because the claim cannot be edited. It
0254: only recalls what each column held when it was read, so there is
0255: nothing two copies of a frame could legitimately disagree about,
0256: and every way ``dict`` offers to change its contents raises here,
0257: at every depth.
0258:
0259: It is still a ``dict``, so it indexes, iterates, compares and
0260: serializes exactly like a plain mapping. It pickles as a plain
0261: ``dict``, so a pickled frame loads without this package installed.
0262: A hand-written plain ``dict`` is read on the way in just the same,
0263: provided it carries the same two keys this one does::
0264:
0265: {'version': 1, 'columns': {'src_ip': {'kind': 'ipv4'}}}
0266:
0267: ``version`` is checked rather than merely carried: a mapping with
0268: any version other than 1 is not a claim this client reads, and
0269: every column in it is ignored. A mapping without the key reads as
0270: version 1. To change what a frame claims,
0271: assign a whole new mapping to ``df.attrs['questdb']``. The nested
0272: ``columns`` mapping is frozen too, so unpack that one as well::
0273:
0274: df.attrs['questdb'] = {
0275: 'version': 1,
0276: 'columns': {
0277: **df.attrs['questdb']['columns'],
0278: 'grade': {'kind': 'char'}}}
0279:
0280: Or state the type outright with ``schema_overrides`` / ``symbols``,
0281: which outrank the claim.
0282: """
+0283: __slots__ = ('_built',)
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_tuple[39]) < (0)) __PYX_ERR(2, 283, __pyx_L1_error) /* … */ { PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_built}; __pyx_mstate_global->__pyx_tuple[39] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[39])) __PYX_ERR(2, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[39]); } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[39]);
0284:
+0285: def __init__(self, mapping=()):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_1__init__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_15_RoundtripClaim_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_15_RoundtripClaim_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_1__init__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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;
PyObject *__pyx_v_mapping = 0;
#if !CYTHON_VECTORCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if !CYTHON_VECTORCALL
#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_self,&__pyx_mstate_global->__pyx_n_u_mapping,0};
PyObject* values[2] = {0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 285, __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(2, 285, __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(2, 285, __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(2, 285, __pyx_L3_error)
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_empty_tuple)));
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(2, 285, __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(2, 285, __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(2, 285, __pyx_L3_error)
break;
default: goto __pyx_L5_argtuple_error;
}
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_empty_tuple)));
}
__pyx_v_self = values[0];
__pyx_v_mapping = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(2, 285, __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("questdb._client._RoundtripClaim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7questdb_7_client_15_RoundtripClaim___init__(__pyx_self, __pyx_v_self, __pyx_v_mapping);
/* 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_7questdb_7_client_15_RoundtripClaim___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mapping) {
PyObject *__pyx_v_items = NULL;
PyObject *__pyx_8genexpr1__pyx_v_key = NULL;
PyObject *__pyx_8genexpr1__pyx_v_value = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* 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_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("questdb._client._RoundtripClaim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_items);
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key);
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_15_RoundtripClaim_1__init__, 0, __pyx_mstate_global->__pyx_n_u_RoundtripClaim___init, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[40]);
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < (0)) __PYX_ERR(2, 285, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
/* … */
{
PyObject* __pyx_temp[1] = {((PyObject*)__pyx_mstate_global->__pyx_empty_tuple)};
__pyx_mstate_global->__pyx_tuple[40] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[40])) __PYX_ERR(2, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[40]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[40]);
0286: # Every mapping inside the claim is frozen too, so no part of
0287: # it can be edited in place. `dict.__init__` inserts at the C
0288: # level and so is not turned away by the override below --
0289: # which also means calling `__init__` again on a built claim
0290: # would edit it in place, past every other guard.
0291: #
0292: # Refused on the second call rather than on a non-empty target:
0293: # a result with no columns builds an empty claim, and gating on
0294: # emptiness left that one re-initialisable.
0295: # An unset slot raises on read, so `getattr` with a default is
0296: # what distinguishes the first call from a later one.
+0297: if getattr(self, '_built', False):
__pyx_t_1 = __Pyx_GetAttr3(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_built, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+0298: self._immutable()
__pyx_t_3 = __pyx_v_self;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_immutable, __pyx_callargs+__pyx_t_4, (1-__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(2, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0299: self._built = True
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_built, Py_True) < (0)) __PYX_ERR(2, 299, __pyx_L1_error)
+0300: items = mapping.items() if isinstance(mapping, dict) else mapping
__pyx_t_2 = PyDict_Check(__pyx_v_mapping); if (__pyx_t_2) { __pyx_t_5 = __pyx_v_mapping; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_items, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_v_mapping); __pyx_t_1 = __pyx_v_mapping; } __pyx_v_items = __pyx_t_1; __pyx_t_1 = 0;
+0301: dict.__init__(self, [
__pyx_t_3 = ((PyObject *)(&PyDict_Type)); __Pyx_INCREF(__pyx_t_3); { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 301, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5);
+0302: (key, _RoundtripClaim(value) if isinstance(value, dict) else value)
__pyx_t_2 = PyDict_Check(__pyx_8genexpr1__pyx_v_value); if (__pyx_t_2) { __pyx_t_10 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_RoundtripClaim); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 302, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_4 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_8genexpr1__pyx_v_value}; __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 302, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); } __pyx_t_9 = __pyx_t_11; __pyx_t_11 = 0; } else { __Pyx_INCREF(__pyx_8genexpr1__pyx_v_value); __pyx_t_9 = __pyx_8genexpr1__pyx_v_value; } __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 302, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_8genexpr1__pyx_v_key); __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_key); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_8genexpr1__pyx_v_key) != (0)) __PYX_ERR(2, 302, __pyx_L6_error); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9) != (0)) __PYX_ERR(2, 302, __pyx_L6_error); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_11); if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_5, __pyx_t_11))) __PYX_ERR(2, 301, __pyx_L6_error) __pyx_t_11 = 0;
+0303: for key, value in items])
if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) { __pyx_t_6 = __pyx_v_items; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 303, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 303, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 303, __pyx_L6_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_6, __pyx_t_7)); #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7); #endif ++__pyx_t_7; } if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 303, __pyx_L6_error) } else { __pyx_t_9 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 303, __pyx_L6_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_9); if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) { PyObject* sequence = __pyx_t_9; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(2, 303, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_11); } else { __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_XGOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_XGOTREF(__pyx_t_11); } #else __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { Py_ssize_t index = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 303, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < (0)) __PYX_ERR(2, 303, __pyx_L6_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(2, 303, __pyx_L6_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_key, __pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_value, __pyx_t_11); __pyx_t_11 = 0; /* … */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; goto __pyx_L12_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_self, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__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_1)) __PYX_ERR(2, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0304:
+0305: def __deepcopy__(self, memo):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_3__deepcopy__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_15_RoundtripClaim_3__deepcopy__ = {"__deepcopy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_15_RoundtripClaim_3__deepcopy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_3__deepcopy__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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;
CYTHON_UNUSED PyObject *__pyx_v_memo = 0;
#if !CYTHON_VECTORCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0);
#if !CYTHON_VECTORCALL
#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_self,&__pyx_mstate_global->__pyx_n_u_memo,0};
PyObject* values[2] = {0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 305, __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(2, 305, __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(2, 305, __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, "__deepcopy__", 0) < (0)) __PYX_ERR(2, 305, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 2, 2, i); __PYX_ERR(2, 305, __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(2, 305, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 305, __pyx_L3_error)
}
__pyx_v_self = values[0];
__pyx_v_memo = values[1];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 2, 2, __pyx_nargs); __PYX_ERR(2, 305, __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("questdb._client._RoundtripClaim.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7questdb_7_client_15_RoundtripClaim_2__deepcopy__(__pyx_self, __pyx_v_self, __pyx_v_memo);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 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_7questdb_7_client_15_RoundtripClaim_2__deepcopy__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_memo) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_15_RoundtripClaim_3__deepcopy__, 0, __pyx_mstate_global->__pyx_n_u_RoundtripClaim___deepcopy, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_deepcopy, __pyx_t_11) < (0)) __PYX_ERR(2, 305, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0306: return self
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0307:
+0308: def __copy__(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_5__copy__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_15_RoundtripClaim_5__copy__ = {"__copy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_15_RoundtripClaim_5__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_5__copy__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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;
#if !CYTHON_VECTORCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
#if !CYTHON_VECTORCALL
#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_self,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 308, __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(2, 308, __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, "__copy__", 0) < (0)) __PYX_ERR(2, 308, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__copy__", 1, 1, 1, i); __PYX_ERR(2, 308, __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(2, 308, __pyx_L3_error)
}
__pyx_v_self = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__copy__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 308, __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("questdb._client._RoundtripClaim.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7questdb_7_client_15_RoundtripClaim_4__copy__(__pyx_self, __pyx_v_self);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 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_7questdb_7_client_15_RoundtripClaim_4__copy__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_15_RoundtripClaim_5__copy__, 0, __pyx_mstate_global->__pyx_n_u_RoundtripClaim___copy, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_copy_2, __pyx_t_11) < (0)) __PYX_ERR(2, 308, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0309: return self
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0310:
+0311: def __reduce__(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_7__reduce__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_15_RoundtripClaim_7__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_15_RoundtripClaim_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_7__reduce__(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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;
#if !CYTHON_VECTORCALL
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_VECTORCALL
#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_self,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 311, __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(2, 311, __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, "__reduce__", 0) < (0)) __PYX_ERR(2, 311, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 1, 1, i); __PYX_ERR(2, 311, __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(2, 311, __pyx_L3_error)
}
__pyx_v_self = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__reduce__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 311, __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("questdb._client._RoundtripClaim.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7questdb_7_client_15_RoundtripClaim_6__reduce__(__pyx_self, __pyx_v_self);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 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_7questdb_7_client_15_RoundtripClaim_6__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._RoundtripClaim.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_15_RoundtripClaim_7__reduce__, 0, __pyx_mstate_global->__pyx_n_u_RoundtripClaim___reduce, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_11) < (0)) __PYX_ERR(2, 311, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
0312: # Pickled as a plain dict, nested mappings included, so a pickle
0313: # names no class of this package: a pickled frame loads wherever
0314: # pandas does, with or without this package installed. The frame
0315: # it loads into carries an ordinary dict. `dataframe()` reads it
0316: # the same way, and `_dataframe_freeze_claim` freezes it for the
0317: # length of a write, so the per-column copies pandas makes stay
0318: # cheap there too.
+0319: return (dict, (_plain_mapping(self),))
__pyx_t_1 = __pyx_f_7questdb_7_client__plain_mapping(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 319, __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(2, 319, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((PyObject *)(&PyDict_Type)); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyDict_Type))) != (0)) __PYX_ERR(2, 319, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2) != (0)) __PYX_ERR(2, 319, __pyx_L1_error); __pyx_t_2 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_1; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L0;
0320:
+0321: def _immutable(self, *args, **kwargs):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_9_immutable(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_15_RoundtripClaim_9_immutable = {"_immutable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_15_RoundtripClaim_9_immutable, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_15_RoundtripClaim_9_immutable(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_self = 0;
CYTHON_UNUSED PyObject *__pyx_v_args = 0;
CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
#if !CYTHON_VECTORCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_immutable (wrapper)", 0);
#if !CYTHON_VECTORCALL
#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_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs);
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_v_args);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 321, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
default:
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 321, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, __pyx_kwds_len, "_immutable", 1) < (0)) __PYX_ERR(2, 321, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_immutable", 0, 1, 1, i); __PYX_ERR(2, 321, __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(2, 321, __pyx_L3_error)
}
__pyx_v_self = values[0];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_immutable", 0, 1, 1, __pyx_nargs); __PYX_ERR(2, 321, __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_args); __pyx_v_args = 0;
__Pyx_XDECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("questdb._client._RoundtripClaim._immutable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7questdb_7_client_15_RoundtripClaim_8_immutable(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 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_DECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_7questdb_7_client_15_RoundtripClaim_8_immutable(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._RoundtripClaim._immutable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_15_RoundtripClaim_9_immutable, 0, __pyx_mstate_global->__pyx_n_u_RoundtripClaim__immutable, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
#endif
if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable, __pyx_t_11) < (0)) __PYX_ERR(2, 321, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0322: raise TypeError(
__pyx_t_2 = NULL;
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_df_attrs_questdb_records_what_ea};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_1)) __PYX_ERR(2, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(2, 322, __pyx_L1_error)
0323: "df.attrs['questdb'] records what each column held when it "
0324: 'was read and cannot be edited in place, because every copy '
0325: 'of the frame shares it. Assign a whole new mapping to '
0326: "df.attrs['questdb'] instead; the nested 'columns' mapping "
0327: 'is frozen too, so unpack that one as well: '
0328: "df.attrs['questdb'] = {'version': 1, 'columns': "
0329: "{**df.attrs['questdb']['columns'], "
0330: "'grade': {'kind': 'char'}}}. Or state the type outright "
0331: 'with schema_overrides / symbols, which outrank the '
0332: 'claim.')
0333:
0334: # Every method `dict` has that changes its contents. Blocking them
0335: # one by one is what lets the claim be shared rather than copied,
0336: # so the set has to be complete: the test walks `dir(dict)` and
0337: # calls each name, which turns a missing entry here into a test
0338: # failure rather than a claim that changes under a frame sharing it.
+0339: __setitem__ = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_setitem, __pyx_t_11) < (0)) __PYX_ERR(2, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0340: __delitem__ = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_delitem, __pyx_t_11) < (0)) __PYX_ERR(2, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0341: __ior__ = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ior, __pyx_t_11) < (0)) __PYX_ERR(2, 341, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0342: setdefault = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_setdefault, __pyx_t_11) < (0)) __PYX_ERR(2, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0343: pop = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_pop, __pyx_t_11) < (0)) __PYX_ERR(2, 343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0344: popitem = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_popitem, __pyx_t_11) < (0)) __PYX_ERR(2, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0345: update = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_update, __pyx_t_11) < (0)) __PYX_ERR(2, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0346: clear = _immutable
__pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_immutable); if (unlikely(!__pyx_t_11)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_immutable); } if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__Pyx_SetNameInClass(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_11) < (0)) __PYX_ERR(2, 346, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
0347:
0348:
0349: # A claim is three mappings deep: the claim, its `columns` mapping and a
0350: # column's entry. `_RoundtripClaim` freezes one mapping per level of C
0351: # recursion, so a bound well above that keeps the recursion shallow
0352: # however little stack the calling thread has.
+0353: cdef int _CLAIM_FREEZE_MAX_DEPTH = 16
__pyx_v_7questdb_7_client__CLAIM_FREEZE_MAX_DEPTH = 16;
0354:
0355:
+0356: cdef bint _claim_nesting_is_bounded(object claim) except -1:
static int __pyx_f_7questdb_7_client__claim_nesting_is_bounded(PyObject *__pyx_v_claim) {
PyObject *__pyx_v_pending = 0;
PyObject *__pyx_v_mapping = 0;
PyObject *__pyx_v_value = 0;
int __pyx_v_depth;
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._claim_nesting_is_bounded", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pending);
__Pyx_XDECREF(__pyx_v_mapping);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XDECREF(__pyx_v__);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0357: """Whether no mapping in `claim` sits more than
0358: `_CLAIM_FREEZE_MAX_DEPTH` levels down.
0359:
0360: `_RoundtripClaim` freezes a claim by recursing into every mapping it
0361: holds, so the depth has to be known before freezing starts. On
0362: Python 3.12 and 3.13 that recursion counts against a C-level limit
0363: that does not track the real stack, so on a stack of a few
0364: megabytes -- a Windows main thread's, for one -- the interpreter
0365: dies of a stack overflow before `RecursionError` can be raised. This
0366: walk keeps its own list of pending mappings, so it uses no C stack
0367: per level.
0368:
0369: A claim that contains itself has no bottom, so its depth runs past
0370: the bound and the walk stops there. A mapping that two entries
0371: share is not a cycle; it is walked once per entry, the way the
0372: freeze copies it once per entry.
0373: """
+0374: cdef list pending = [(claim, 1)]
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_claim); __Pyx_GIVEREF(__pyx_v_claim); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_claim) != (0)) __PYX_ERR(2, 374, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(2, 374, __pyx_L1_error); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(2, 374, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_pending = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0;
0375: cdef object mapping, value
0376: cdef int depth
+0377: while pending:
while (1) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_pending);
if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(2, 377, __pyx_L1_error)
__pyx_t_3 = (__pyx_temp != 0);
}
if (!__pyx_t_3) break;
+0378: mapping, depth = pending.pop()
__pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(2, 378, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); } #else __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(2, 378, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(2, 378, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_mapping, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_depth = __pyx_t_7;
+0379: if depth > _CLAIM_FREEZE_MAX_DEPTH:
__pyx_t_3 = (__pyx_v_depth > __pyx_v_7questdb_7_client__CLAIM_FREEZE_MAX_DEPTH);
if (__pyx_t_3) {
/* … */
}
+0380: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
+0381: for _, value in mapping.items():
__pyx_t_8 = 0;
if (unlikely(__pyx_v_mapping == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 381, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_dict_iterator(__pyx_v_mapping, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_9), (&__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_2);
__pyx_t_2 = __pyx_t_4;
__pyx_t_4 = 0;
while (1) {
__pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_9, &__pyx_t_8, &__pyx_t_4, &__pyx_t_1, NULL, __pyx_t_7);
if (unlikely(__pyx_t_10 == 0)) break;
if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(2, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v__, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
__pyx_t_1 = 0;
+0382: if isinstance(value, dict):
__pyx_t_3 = PyDict_Check(__pyx_v_value); if (__pyx_t_3) { /* … */ } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; }
+0383: pending.append((value, depth + 1))
__pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_depth + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value) != (0)) __PYX_ERR(2, 383, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 383, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_pending, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+0384: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
0385:
0386:
+0387: cdef object _dataframe_freeze_claim(object df):
static PyObject *__pyx_f_7questdb_7_client__dataframe_freeze_claim(PyObject *__pyx_v_df) {
PyObject *__pyx_v_attrs = 0;
PyObject *__pyx_v_claim = 0;
PyObject *__pyx_v_frozen = 0;
PyObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("questdb._client._dataframe_freeze_claim", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_attrs);
__Pyx_XDECREF(__pyx_v_claim);
__Pyx_XDECREF(__pyx_v_frozen);
__Pyx_XDECREF(__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0388: """`df`, or a shallow copy of it whose ``df.attrs['questdb']`` is a
0389: `_RoundtripClaim`, when `df` is a pandas frame carrying its claim
0390: as a plain ``dict``.
0391:
0392: pandas deep-copies the whole of ``attrs`` into every frame and
0393: Series derived from `df`, and a write derives a Series per column,
0394: in the planner or in pandas' Arrow export, so a plain claim with an
0395: entry per column makes the write quadratic in the column count. A
0396: claim is a plain ``dict`` when its frame was unpickled, or when it
0397: was written or replaced by hand. Frozen, it is shared rather than
0398: copied, and both readers read it the same way.
0399:
0400: The copy shares the frame's data and gets an ``attrs`` dict of its
0401: own, so `df` and its claim are left as they are. A claim that
0402: contains itself, or nests deeper than `_CLAIM_FREEZE_MAX_DEPTH`,
0403: cannot be frozen; it stays plain, and pandas copies it the way it
0404: copies any plain ``dict``.
0405: """
0406: cdef object attrs, claim, frozen, out
+0407: if not _is_pandas_dataframe_object(df):
__pyx_t_1 = __pyx_f_7questdb_7_client__is_pandas_dataframe_object(__pyx_v_df); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 407, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* … */ }
+0408: return df
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_df);
__pyx_r = __pyx_v_df;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0409: attrs = getattr(df, 'attrs', None)
__pyx_t_3 = __Pyx_GetAttr3(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_attrs, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_attrs = __pyx_t_3; __pyx_t_3 = 0;
+0410: if not isinstance(attrs, dict):
__pyx_t_2 = PyDict_Check(__pyx_v_attrs);
__pyx_t_1 = (!__pyx_t_2);
if (__pyx_t_1) {
/* … */
}
+0411: return df
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_df);
__pyx_r = __pyx_v_df;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0412: claim = attrs.get('questdb')
__pyx_t_4 = __pyx_v_attrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_questdb}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __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(2, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_claim = __pyx_t_3; __pyx_t_3 = 0;
+0413: if not isinstance(claim, dict) or isinstance(claim, _RoundtripClaim):
__pyx_t_2 = PyDict_Check(__pyx_v_claim); __pyx_t_6 = (!__pyx_t_2); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_RoundtripClaim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyObject_IsInstance(__pyx_v_claim, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (__pyx_t_1) { /* … */ }
+0414: return df
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_df);
__pyx_r = __pyx_v_df;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0415: if not _claim_nesting_is_bounded(claim):
__pyx_t_1 = __pyx_f_7questdb_7_client__claim_nesting_is_bounded(__pyx_v_claim); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 415, __pyx_L1_error)
__pyx_t_6 = (!__pyx_t_1);
if (__pyx_t_6) {
/* … */
}
+0416: return df
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_df);
__pyx_r = __pyx_v_df;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0417: frozen = _RoundtripClaim(claim)
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_RoundtripClaim); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_claim}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __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_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_frozen = __pyx_t_3; __pyx_t_3 = 0;
+0418: out = df.copy(deep=False)
__pyx_t_7 = __pyx_v_df; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, Py_False}; #if CYTHON_VECTORCALL __pyx_t_4 = __pyx_mstate_global->__pyx_tuple[2]; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_INCREF(__pyx_t_4); #else { PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_deep}; __pyx_t_4 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } #endif __pyx_t_3 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_out = __pyx_t_3; __pyx_t_3 = 0; /* … */ { PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_deep}; __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(2, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
+0419: out.attrs = {**attrs, 'questdb': frozen}
if (unlikely(__pyx_v_attrs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(2, 419, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_attrs))) {
__pyx_t_3 = PyDict_Copy(__pyx_v_attrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
__pyx_t_3 = __Pyx_PyObject_CallOneArg((PyObject*)&PyDict_Type, __pyx_v_attrs); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_questdb, __pyx_v_frozen) < (0)) __PYX_ERR(2, 419, __pyx_L1_error)
if (__Pyx_PyObject_SetAttrStr(__pyx_v_out, __pyx_mstate_global->__pyx_n_u_attrs, __pyx_t_3) < (0)) __PYX_ERR(2, 419, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0420: return out
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_out);
__pyx_r = __pyx_v_out;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0421:
0422:
+0423: cdef object _roundtrip_columns_meta(object frame):
static PyObject *__pyx_f_7questdb_7_client__roundtrip_columns_meta(PyObject *__pyx_v_frame) {
PyObject *__pyx_v_attrs = 0;
PyObject *__pyx_v_qmeta = 0;
PyObject *__pyx_v_cols_meta = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._roundtrip_columns_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_attrs);
__Pyx_XDECREF(__pyx_v_qmeta);
__Pyx_XDECREF(__pyx_v_cols_meta);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0424: """The ``columns`` map of a frame's ``df.attrs['questdb']``, or
0425: ``None`` where the frame carries no claim this client can read.
0426:
0427: Both ingest-side readers start here, so a malformed or
0428: future-versioned ``attrs`` is turned away in one place rather than
0429: at two call sites with two different sets of guards.
0430:
0431: The version is checked rather than merely carried. The claim's
0432: vocabulary can gain kinds, and a client that applied a version it
0433: does not understand would silently write the wrong column type --
0434: the outcome the claim exists to prevent.
0435:
0436: Reading is silent; `_dataframe_log_claim_problems` reports what
0437: this turns away, once per write.
0438: """
0439: cdef object attrs, qmeta, cols_meta
+0440: attrs = getattr(frame, 'attrs', None)
__pyx_t_1 = __Pyx_GetAttr3(__pyx_v_frame, __pyx_mstate_global->__pyx_n_u_attrs, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = __pyx_t_1; __pyx_t_1 = 0;
+0441: if not isinstance(attrs, dict):
__pyx_t_2 = PyDict_Check(__pyx_v_attrs);
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
/* … */
}
+0442: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0443: qmeta = attrs.get('questdb')
__pyx_t_4 = __pyx_v_attrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_questdb}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __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_1)) __PYX_ERR(2, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_qmeta = __pyx_t_1; __pyx_t_1 = 0;
+0444: if not isinstance(qmeta, dict):
__pyx_t_3 = PyDict_Check(__pyx_v_qmeta);
__pyx_t_2 = (!__pyx_t_3);
if (__pyx_t_2) {
/* … */
}
+0445: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0446: if not _roundtrip_version_supported(qmeta):
__pyx_t_2 = __pyx_f_7questdb_7_client__roundtrip_version_supported(__pyx_v_qmeta); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 446, __pyx_L1_error)
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
/* … */
}
+0447: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0448: cols_meta = qmeta.get('columns')
__pyx_t_4 = __pyx_v_qmeta; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_columns}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __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_1)) __PYX_ERR(2, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_cols_meta = __pyx_t_1; __pyx_t_1 = 0;
+0449: if not isinstance(cols_meta, dict):
__pyx_t_3 = PyDict_Check(__pyx_v_cols_meta);
__pyx_t_2 = (!__pyx_t_3);
if (__pyx_t_2) {
/* … */
}
+0450: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0451: return cols_meta
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_cols_meta);
__pyx_r = __pyx_v_cols_meta;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0452:
0453:
+0454: cdef bint _roundtrip_version_supported(object qmeta) except -1:
static int __pyx_f_7questdb_7_client__roundtrip_version_supported(PyObject *__pyx_v_qmeta) {
PyObject *__pyx_v_version = NULL;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._roundtrip_version_supported", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_version);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0455: """Whether a claim's ``version`` is one this client reads.
0456:
0457: A claim with no ``version`` key reads as version 1. Version 1 is the
0458: only one there has been, so a mapping without the key can only be a
0459: hand-written version-1 claim, and 5.0 read those. A version that is
0460: present must be a whole number equal to 1: any other value is a
0461: vocabulary this client would have to guess at.
0462: """
+0463: if 'version' not in qmeta:
__pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_version, __pyx_v_qmeta, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 463, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+0464: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
+0465: version = qmeta['version']
__pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_qmeta, __pyx_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_version = __pyx_t_2; __pyx_t_2 = 0;
+0466: return (_is_integral_not_bool(version)
__pyx_t_3 = __pyx_f_7questdb_7_client__is_integral_not_bool(__pyx_v_version); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 466, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; }
+0467: and int(version) == _ROUNDTRIP_META_VERSION)
__pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_7questdb_7_client__ROUNDTRIP_META_VERSION); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_CompareBoolEq_int_int(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; { __pyx_r = __pyx_t_1; } goto __pyx_L0;
0468:
0469:
0470: # Every kind a claim can name: the ones the egress stamps, `'unknown'`
0471: # included for a column it could not name, plus the ones only a
0472: # hand-written claim states. Built on first use, because the egress
0473: # vocabulary is defined after this file is included.
+0474: cdef object _ROUNDTRIP_KNOWN_KINDS = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS, Py_None); __Pyx_GIVEREF(Py_None);
0475:
0476:
+0477: cdef object _roundtrip_known_kinds():
static PyObject *__pyx_f_7questdb_7_client__roundtrip_known_kinds(void) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._roundtrip_known_kinds", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0478: global _ROUNDTRIP_KNOWN_KINDS
+0479: if _ROUNDTRIP_KNOWN_KINDS is None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS == Py_None);
if (__pyx_t_1) {
/* … */
}
+0480: _ROUNDTRIP_KNOWN_KINDS = frozenset(
__pyx_t_2 = __Pyx_PyFrozenSet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0;
+0481: set(_KIND_NAMES.values())
if (unlikely(__pyx_v_7questdb_7_client__KIND_NAMES == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "values");
__PYX_ERR(2, 481, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_PyDict_Values(__pyx_v_7questdb_7_client__KIND_NAMES); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0482: | set(_ATTRS_OVERRIDE_KINDS)
__pyx_t_2 = PySet_New(__pyx_v_7questdb_7_client__ATTRS_OVERRIDE_KINDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Or(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date) < (0)) __PYX_ERR(2, 483, __pyx_L1_error) if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_unknown) < (0)) __PYX_ERR(2, 483, __pyx_L1_error)
+0483: | {'date', 'unknown'})
__pyx_t_3 = PyNumber_Or(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0484: return _ROUNDTRIP_KNOWN_KINDS
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS);
__pyx_r = __pyx_v_7questdb_7_client__ROUNDTRIP_KNOWN_KINDS;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
0485:
0486:
0487: _ROUNDTRIP_CLAIM_SHAPE = (
+0488: "{'version': 1, 'columns': {'src_ip': {'kind': 'ipv4'}, "
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ROUNDTRIP_CLAIM_SHAPE, __pyx_mstate_global->__pyx_kp_u_version_1_columns_src_ip_kind_i) < (0)) __PYX_ERR(2, 487, __pyx_L1_error)
0489: "'pos': {'kind': 'geohash', 'precision_bits': 20}}}")
0490:
0491:
+0492: cdef void_int _dataframe_log_claim_problems(object df) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_log_claim_problems(PyObject *__pyx_v_df) {
PyObject *__pyx_v_attrs = 0;
PyObject *__pyx_v_qmeta = 0;
PyObject *__pyx_v_cols_meta = 0;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_meta = 0;
PyObject *__pyx_v_raw_kind = 0;
PyObject *__pyx_v_kind = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_log_claim_problems", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_attrs);
__Pyx_XDECREF(__pyx_v_qmeta);
__Pyx_XDECREF(__pyx_v_cols_meta);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_meta);
__Pyx_XDECREF(__pyx_v_raw_kind);
__Pyx_XDECREF(__pyx_v_kind);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0493: """Log every part of ``df.attrs['questdb']`` that is not read.
0494:
0495: The readers skip a claim they cannot parse, which is right for the
0496: write -- the claim travels with the data, and a frame can carry
0497: `attrs` its caller never looked at -- but a skipped claim is also
0498: how a column reaches the database as the wrong type. This says what
0499: was skipped and why.
0500:
0501: A problem with the claim as a whole turns all of it away and is
0502: reported once. A problem with one column's entry turns away only
0503: that entry and is reported per column. A claimed column missing from
0504: the frame is drift, which the claim rides out quietly, so it is not
0505: reported here.
0506:
0507: Called once per write, from `_dataframe` and `_direct_dataframe_run`,
0508: rather than from the readers, which run several times per write.
0509: """
0510: cdef object attrs, qmeta, cols_meta, name, meta, raw_kind
0511: cdef str kind
+0512: attrs = getattr(df, 'attrs', None)
__pyx_t_1 = __Pyx_GetAttr3(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_attrs, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = __pyx_t_1; __pyx_t_1 = 0;
+0513: if not isinstance(attrs, dict) or 'questdb' not in attrs:
__pyx_t_3 = PyDict_Check(__pyx_v_attrs); __pyx_t_4 = (!__pyx_t_3); if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_questdb, __pyx_v_attrs, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 513, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* … */ }
+0514: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+0515: qmeta = attrs['questdb']
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_attrs, __pyx_mstate_global->__pyx_n_u_questdb); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qmeta = __pyx_t_1; __pyx_t_1 = 0;
+0516: if not isinstance(qmeta, dict):
__pyx_t_2 = PyDict_Check(__pyx_v_qmeta);
__pyx_t_4 = (!__pyx_t_2);
if (__pyx_t_4) {
/* … */
}
+0517: _log_roundtrip_claim_unread(
__pyx_t_5 = __pyx_f_7questdb_7_client__log_roundtrip_claim_unread(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0518: f'it is a {type(qmeta).__name__}, not a mapping')
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_qmeta)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_it_is_a; __pyx_t_6[1] = __pyx_t_5; __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_not_a_mapping; __pyx_t_7 = 23; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6[1]); #endif __pyx_t_8 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 |= __Pyx_PyUnicode_KIND_04(__pyx_t_6[1]); #endif __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0519: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+0520: if not _roundtrip_version_supported(qmeta):
__pyx_t_4 = __pyx_f_7questdb_7_client__roundtrip_version_supported(__pyx_v_qmeta); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 520, __pyx_L1_error)
__pyx_t_2 = (!__pyx_t_4);
if (__pyx_t_2) {
/* … */
}
+0521: _log_roundtrip_claim_unread(
__pyx_t_1 = __pyx_f_7questdb_7_client__log_roundtrip_claim_unread(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0522: f"its 'version' is {qmeta['version']!r}, and this client "
__pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_qmeta, __pyx_mstate_global->__pyx_n_u_version); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_its_version_is; __pyx_t_6[1] = __pyx_t_1; __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_and_this_client_reads_version_1; __pyx_t_7 = 50; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6[1]); #endif __pyx_t_8 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 |= __Pyx_PyUnicode_KIND_04(__pyx_t_6[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0523: 'reads version 1')
+0524: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+0525: cols_meta = qmeta.get('columns')
__pyx_t_5 = __pyx_v_qmeta; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_columns}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_cols_meta = __pyx_t_1; __pyx_t_1 = 0;
+0526: if not isinstance(cols_meta, dict):
__pyx_t_2 = PyDict_Check(__pyx_v_cols_meta);
__pyx_t_4 = (!__pyx_t_2);
if (__pyx_t_4) {
/* … */
}
+0527: _log_roundtrip_claim_unread(
__pyx_t_1 = __pyx_f_7questdb_7_client__log_roundtrip_claim_unread(__pyx_mstate_global->__pyx_kp_u_its_columns_entry_is_missing_or); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0528: "its 'columns' entry is missing or not a mapping")
+0529: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+0530: for name, meta in cols_meta.items():
__pyx_t_7 = 0;
if (unlikely(__pyx_v_cols_meta == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 530, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_dict_iterator(__pyx_v_cols_meta, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_10), (&__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
while (1) {
__pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_7, &__pyx_t_5, &__pyx_t_11, NULL, __pyx_t_8);
if (unlikely(__pyx_t_12 == 0)) break;
if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(2, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_11);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_XDECREF_SET(__pyx_v_meta, __pyx_t_11);
__pyx_t_11 = 0;
+0531: if not isinstance(meta, dict):
__pyx_t_4 = PyDict_Check(__pyx_v_meta);
__pyx_t_2 = (!__pyx_t_4);
if (__pyx_t_2) {
/* … */
}
+0532: _log_roundtrip_claim_entry_unread(
__pyx_t_11 = __pyx_f_7questdb_7_client__log_roundtrip_claim_entry_unread(__pyx_v_name, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0533: name, f'the entry is {meta!r}, not a mapping')
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_meta), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_the_entry_is; __pyx_t_6[1] = __pyx_t_11; __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_not_a_mapping; __pyx_t_13 = 28; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6[1]); #endif __pyx_t_12 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_6[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0534: continue
goto __pyx_L9_continue;
+0535: raw_kind = meta.get('kind')
__pyx_t_5 = __pyx_v_meta;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kind};
__pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__Pyx_XDECREF_SET(__pyx_v_raw_kind, __pyx_t_11);
__pyx_t_11 = 0;
+0536: if not isinstance(raw_kind, str):
__pyx_t_2 = PyUnicode_Check(__pyx_v_raw_kind);
__pyx_t_4 = (!__pyx_t_2);
if (__pyx_t_4) {
/* … */
}
+0537: _log_roundtrip_claim_entry_unread(
__pyx_t_11 = __pyx_f_7questdb_7_client__log_roundtrip_claim_entry_unread(__pyx_v_name, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0538: name, f"its 'kind' is {raw_kind!r}, not a string")
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_raw_kind), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_its_kind_is; __pyx_t_6[1] = __pyx_t_11; __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_not_a_string; __pyx_t_13 = 28; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6[1]); #endif __pyx_t_12 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_6[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0539: continue
goto __pyx_L9_continue;
0540: # The kind the readers act on, so this reports exactly what
0541: # they skip.
+0542: kind = _roundtrip_kind(meta)
__pyx_t_11 = __pyx_f_7questdb_7_client__roundtrip_kind(__pyx_v_meta); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_kind, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0;
+0543: if kind not in _roundtrip_known_kinds():
__pyx_t_11 = __pyx_f_7questdb_7_client__roundtrip_known_kinds(); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_kind, __pyx_t_11, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_4) { /* … */ } __pyx_L9_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0544: _log_roundtrip_claim_entry_unread(
__pyx_t_11 = __pyx_f_7questdb_7_client__log_roundtrip_claim_entry_unread(__pyx_v_name, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0545: name, f'{kind!r} is not a kind this client knows')
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_kind), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_is_not_a_kind_this_client_knows); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+0546: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
0547:
0548:
0549: # Both notices are logged rather than warned, like every claim notice:
0550: # a claim the write cannot read leaves the write valid, and under
0551: # `-W error` a warning would abort it.
+0552: cdef _log_roundtrip_claim_unread(str reason):
static PyObject *__pyx_f_7questdb_7_client__log_roundtrip_claim_unread(PyObject *__pyx_v_reason) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._log_roundtrip_claim_unread", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+0553: logging.getLogger('questdb').warning(
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 553, __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_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_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_questdb}; __pyx_t_3 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
0554: "questdb: df.attrs['questdb'] is not read, because %s. Every "
0555: 'type claim in it is ignored, and each column goes out as its '
0556: 'own type decides. The shape this client reads is %s.',
0557: reason,
+0558: _ROUNDTRIP_CLAIM_SHAPE)
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ROUNDTRIP_CLAIM_SHAPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_questdb_df_attrs_questdb_is_not, __pyx_v_reason, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_warning, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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(2, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0559:
0560:
+0561: cdef _log_roundtrip_claim_entry_unread(object name, str reason):
static PyObject *__pyx_f_7questdb_7_client__log_roundtrip_claim_entry_unread(PyObject *__pyx_v_name, PyObject *__pyx_v_reason) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._log_roundtrip_claim_entry_unread", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+0562: logging.getLogger('questdb').warning(
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 562, __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_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_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_questdb}; __pyx_t_3 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
0563: "questdb: column %r has a df.attrs['questdb'] entry that is not "
0564: 'read, because %s. Its claim is ignored, and the column goes out '
0565: 'as its own type decides. The shape this client reads is %s.',
0566: name,
0567: reason,
+0568: _ROUNDTRIP_CLAIM_SHAPE)
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ROUNDTRIP_CLAIM_SHAPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_questdb_column_r_has_a_df_attrs, __pyx_v_name, __pyx_v_reason, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_warning, __pyx_callargs+__pyx_t_7, (5-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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(2, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0569:
0570:
+0571: cdef str _roundtrip_kind(object meta):
static PyObject *__pyx_f_7questdb_7_client__roundtrip_kind(PyObject *__pyx_v_meta) {
PyObject *__pyx_v_kind = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._roundtrip_kind", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_kind);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0572: """The ``kind`` of one column's claim, or ``None`` where the entry
0573: is not a claim.
0574:
0575: ``kind`` is user data, and one of its readers looks it up in a dict.
0576: Hashing is the only step there that can fail, so an unhashable value
0577: -- a list, say, from metadata that went through JSON -- would raise
0578: ``TypeError`` where the contract promises the claim is skipped.
0579: Holding it to ``str`` here settles that for both readers.
0580:
0581: A ``str`` subclass -- ``numpy.str_``, a ``(str, Enum)`` member --
0582: comes back as a plain ``str`` holding the same characters, since
0583: every reader goes on to keep it in a ``str``-typed variable, which
0584: takes nothing else. ``str.__str__`` is the conversion because it
0585: reads the characters themselves: ``str()`` would call the
0586: subclass's own ``__str__``, which for a ``(str, Enum)`` member is
0587: ``'Kind.IPV4'``, not ``'ipv4'``.
0588: """
0589: cdef object kind
+0590: if not isinstance(meta, dict):
__pyx_t_1 = PyDict_Check(__pyx_v_meta);
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
/* … */
}
+0591: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0592: kind = meta.get('kind')
__pyx_t_4 = __pyx_v_meta; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kind}; __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __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(2, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_v_kind = __pyx_t_3; __pyx_t_3 = 0;
+0593: if not isinstance(kind, str):
__pyx_t_2 = PyUnicode_Check(__pyx_v_kind);
__pyx_t_1 = (!__pyx_t_2);
if (__pyx_t_1) {
/* … */
}
+0594: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+0595: if type(kind) is not str:
__pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_kind)) != ((PyObject *)(&PyUnicode_Type)));
if (__pyx_t_1) {
/* … */
}
+0596: kind = str.__str__(kind)
__pyx_t_4 = ((PyObject *)(&PyUnicode_Type));
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_kind};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_str, __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(2, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_3);
__pyx_t_3 = 0;
+0597: return kind
__pyx_t_3 = __pyx_v_kind; __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(2, 597, __pyx_L1_error) { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_3); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_3 = 0; goto __pyx_L0;
0598:
0599:
+0600: cdef _log_roundtrip_claim_route(object name, str kind):
static PyObject *__pyx_f_7questdb_7_client__log_roundtrip_claim_route(PyObject *__pyx_v_name, PyObject *__pyx_v_kind) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._log_roundtrip_claim_route", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0601: """Say that a column's claim named a type this write cannot apply.
0602:
0603: The claim is read by the columnar writers. A frame serialized a row
0604: at a time never reaches them, so a claim of one of the QWP-only
0605: kinds does nothing here. The column reaches the database as its own
0606: dtype decides -- typically a LONG, BINARY, or TIMESTAMP rather than
0607: the claimed type -- and the table it creates has that type. Without
0608: this nothing says so.
0609:
0610: Separate from `_log_roundtrip_claim_dropped`, which answers a
0611: different question: there the column cannot carry the kind, here
0612: the route cannot apply it. The remedy differs with it.
0613: """
0614: # This is a diagnostic about a write that remains valid. Keep it out
0615: # of `warnings.warn`: under `-W error` a Python warning would become
0616: # an exception, abort the write, and be translated by `_dataframe`
0617: # into an unrelated InvalidApiCall error.
+0618: logging.getLogger('questdb').warning(
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 618, __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_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_7 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_questdb}; __pyx_t_3 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
0619: 'questdb: column %r carries a df.attrs[\'questdb\'] claim of '
0620: 'kind %r, which this write cannot apply. The claim is read when '
0621: 'a frame is written a column at a time; this one is being '
0622: 'written a row at a time, so the column goes out as its own '
0623: 'dtype decides rather than as the claimed type, and a table '
0624: 'created by this write gets that resulting type. Use '
0625: 'QuestDB.dataframe(), or Sender.dataframe() over a '
0626: 'ws:: or wss:: configuration, to have the claim applied.',
0627: name,
+0628: kind)
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_questdb_column_r_carries_a_df_at, __pyx_v_name, __pyx_v_kind};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_warning, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (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(2, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
0629:
0630:
+0631: cdef bint _row_route_drops_roundtrip_kind(str kind) except -1:
static int __pyx_f_7questdb_7_client__row_route_drops_roundtrip_kind(PyObject *__pyx_v_kind) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._row_route_drops_roundtrip_kind", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
0632: """Whether row serialization has no way to apply this claim.
0633:
0634: DATE deliberately has no Arrow override: its Arrow type is the
0635: claim. It still belongs here because the row route does not run the
0636: normalization that puts that type back on a NumPy datetime column.
0637: """
+0638: return kind == 'date' or kind in _ATTRS_OVERRIDE_KINDS
__pyx_t_2 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_kind, __pyx_mstate_global->__pyx_n_u_date, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 638, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } if (unlikely(__pyx_v_7questdb_7_client__ATTRS_OVERRIDE_KINDS == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable"); __PYX_ERR(2, 638, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_kind, __pyx_v_7questdb_7_client__ATTRS_OVERRIDE_KINDS, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 638, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; { __pyx_r = __pyx_t_1; } goto __pyx_L0;
0639:
0640:
+0641: cdef void_int _dataframe_log_claims_this_route_drops(object df) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_log_claims_this_route_drops(PyObject *__pyx_v_df) {
PyObject *__pyx_v_cols_meta = 0;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_meta = 0;
PyObject *__pyx_v_kind = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._dataframe_log_claims_this_route_drops", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_cols_meta);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_meta);
__Pyx_XDECREF(__pyx_v_kind);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
0642: """Log every claim the row-serializing write silently ignores.
0643:
0644: Placed at `_dataframe`, which is the one entry `Buffer.dataframe`,
0645: `SenderTransaction.dataframe` and `Sender.dataframe` over the
0646: row-serializing protocols all arrive through, so a fourth caller
0647: inherits the notice rather than having to remember it.
0648: """
+0649: cdef object cols_meta = _roundtrip_columns_meta(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__roundtrip_columns_meta(__pyx_v_df); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols_meta = __pyx_t_1; __pyx_t_1 = 0;
0650: cdef object name
0651: cdef object meta
0652: cdef str kind
+0653: if not cols_meta:
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cols_meta); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 653, __pyx_L1_error) __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { /* … */ }
+0654: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+0655: for name, meta in cols_meta.items():
__pyx_t_4 = 0;
if (unlikely(__pyx_v_cols_meta == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 655, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_cols_meta, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_meta, __pyx_t_8);
__pyx_t_8 = 0;
+0656: kind = _roundtrip_kind(meta)
__pyx_t_8 = __pyx_f_7questdb_7_client__roundtrip_kind(__pyx_v_meta); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_kind, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0;
+0657: if (kind is not None
__pyx_t_2 = (__pyx_v_kind != ((PyObject*)Py_None));
if (__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
/* … */
if (__pyx_t_3) {
/* … */
}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0658: and _row_route_drops_roundtrip_kind(kind)):
__pyx_t_2 = __pyx_f_7questdb_7_client__row_route_drops_roundtrip_kind(__pyx_v_kind); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 658, __pyx_L1_error)
__pyx_t_3 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
+0659: _log_roundtrip_claim_route(name, kind)
__pyx_t_8 = __pyx_f_7questdb_7_client__log_roundtrip_claim_route(__pyx_v_name, __pyx_v_kind); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+0660: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
0661:
0662:
0663: cdef dict _TARGET_NAMES = {
+0664: col_target_t.col_target_skip: "skipped",
__pyx_t_4 = __Pyx_PyDict_NewPresized(20); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_skipped) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0665: col_target_t.col_target_table: "table name",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_table_name_2) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0666: col_target_t.col_target_symbol: "symbol",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_symbol) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0667: col_target_t.col_target_column_bool: "boolean",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_boolean) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0668: col_target_t.col_target_column_i64: "integer",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_integer) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0669: col_target_t.col_target_column_f64: "float",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0670: col_target_t.col_target_column_str: "string",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_string) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0671: col_target_t.col_target_column_ts: "timestamp",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_timestamp) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0672: col_target_t.col_target_column_arr_f64: "array",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_array) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0673: col_target_t.col_target_column_decimal: "decimal",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_decimal) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0674: col_target_t.col_target_at: "designated timestamp",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_designated_timestamp) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0675: col_target_t.col_target_column_i8: "byte",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_byte) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0676: col_target_t.col_target_column_i16: "short",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_short) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0677: col_target_t.col_target_column_i32: "int",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0678: col_target_t.col_target_column_f32: "float32",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_float32) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0679: col_target_t.col_target_column_uuid: "uuid",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_uuid) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0680: col_target_t.col_target_column_long256: "long256",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_long256); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_long256) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0681: col_target_t.col_target_column_ipv4: "ipv4",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ipv4) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0682: col_target_t.col_target_column_binary: "binary",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_binary) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+0683: col_target_t.col_target_column_arrow: "arrow",
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_arrow) < (0)) __PYX_ERR(2, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__TARGET_NAMES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__TARGET_NAMES, ((PyObject*)__pyx_t_4)); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0;
0684: }
0685:
0686:
+0687: cdef enum col_source_t:
enum __pyx_t_7questdb_7_client_col_source_t {
__pyx_e_7questdb_7_client_col_source_nulls = 0,
__pyx_e_7questdb_7_client_col_source_bool_pyobj = 0x18AEC,
__pyx_e_7questdb_7_client_col_source_bool_numpy = 0x18E70,
__pyx_e_7questdb_7_client_col_source_bool_arrow = 0x19258,
__pyx_e_7questdb_7_client_col_source_int_pyobj = 0x3118C,
__pyx_e_7questdb_7_client_col_source_u8_numpy = 0x31510,
__pyx_e_7questdb_7_client_col_source_i8_numpy = 0x318F8,
__pyx_e_7questdb_7_client_col_source_u16_numpy = 0x31CE0,
__pyx_e_7questdb_7_client_col_source_i16_numpy = 0x320C8,
__pyx_e_7questdb_7_client_col_source_u32_numpy = 0x324B0,
__pyx_e_7questdb_7_client_col_source_i32_numpy = 0x32898,
__pyx_e_7questdb_7_client_col_source_u64_numpy = 0x32C80,
__pyx_e_7questdb_7_client_col_source_i64_numpy = 0x33068,
__pyx_e_7questdb_7_client_col_source_u8_arrow = 0x33450,
__pyx_e_7questdb_7_client_col_source_i8_arrow = 0x33838,
__pyx_e_7questdb_7_client_col_source_u16_arrow = 0x33C20,
__pyx_e_7questdb_7_client_col_source_i16_arrow = 0x34008,
__pyx_e_7questdb_7_client_col_source_u32_arrow = 0x343F0,
__pyx_e_7questdb_7_client_col_source_i32_arrow = 0x347D8,
__pyx_e_7questdb_7_client_col_source_u64_arrow = 0x34BC0,
__pyx_e_7questdb_7_client_col_source_i64_arrow = 0x34FA8,
__pyx_e_7questdb_7_client_col_source_float_pyobj = 0x4982C,
__pyx_e_7questdb_7_client_col_source_f32_numpy = 0x49BB0,
__pyx_e_7questdb_7_client_col_source_f64_numpy = 0x49F98,
__pyx_e_7questdb_7_client_col_source_f32_arrow = 0x4A380,
__pyx_e_7questdb_7_client_col_source_f64_arrow = 0x4A768,
__pyx_e_7questdb_7_client_col_source_str_pyobj = 0x61ECC,
__pyx_e_7questdb_7_client_col_source_str_utf8_arrow = 0x62250,
__pyx_e_7questdb_7_client_col_source_str_i8_cat = 0x62638,
__pyx_e_7questdb_7_client_col_source_str_i16_cat = 0x62A20,
__pyx_e_7questdb_7_client_col_source_str_i32_cat = 0x62E08,
__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow = 0x631F0,
__pyx_e_7questdb_7_client_col_source_dt64ns_numpy = 0x7A508,
__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow = 0x7A8F0,
__pyx_e_7questdb_7_client_col_source_dt64us_numpy = 0x92BA8,
__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow = 0x92F90,
__pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow = 0x93378,
__pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow = 0x93760,
__pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj = 0xAB2AC,
__pyx_e_7questdb_7_client_col_source_decimal_pyobj = 0xC394C,
__pyx_e_7questdb_7_client_col_source_decimal32_arrow = 0xC3CD0,
__pyx_e_7questdb_7_client_col_source_decimal64_arrow = 0xC40B8,
__pyx_e_7questdb_7_client_col_source_decimal128_arrow = 0xC44A0,
__pyx_e_7questdb_7_client_col_source_decimal256_arrow = 0xC4888,
__pyx_e_7questdb_7_client_col_source_fsb16_arrow = 0xDBF88,
__pyx_e_7questdb_7_client_col_source_fsb_claimed_arrow = 0xDC370,
__pyx_e_7questdb_7_client_col_source_uuid_pyobj = 0xDC7BC,
__pyx_e_7questdb_7_client_col_source_ipv4_pyobj = 0xDCBA4,
__pyx_e_7questdb_7_client_col_source_datetime_pyobj = 0xDCF8C,
__pyx_e_7questdb_7_client_col_source_bytes_pyobj = 0xDD374,
__pyx_e_7questdb_7_client_col_source_arrow_passthrough = 0xF4240
};
0688: # Note: Hundreds digit set to 1 if GIL is required.
0689: col_source_nulls = 0
0690: col_source_bool_pyobj = 101100
0691: col_source_bool_numpy = 102000
0692: col_source_bool_arrow = 103000
0693: col_source_int_pyobj = 201100
0694: col_source_u8_numpy = 202000
0695: col_source_i8_numpy = 203000
0696: col_source_u16_numpy = 204000
0697: col_source_i16_numpy = 205000
0698: col_source_u32_numpy = 206000
0699: col_source_i32_numpy = 207000
0700: col_source_u64_numpy = 208000
0701: col_source_i64_numpy = 209000
0702: col_source_u8_arrow = 210000
0703: col_source_i8_arrow = 211000
0704: col_source_u16_arrow = 212000
0705: col_source_i16_arrow = 213000
0706: col_source_u32_arrow = 214000
0707: col_source_i32_arrow = 215000
0708: col_source_u64_arrow = 216000
0709: col_source_i64_arrow = 217000
0710: col_source_float_pyobj = 301100
0711: col_source_f32_numpy = 302000
0712: col_source_f64_numpy = 303000
0713: col_source_f32_arrow = 304000
0714: col_source_f64_arrow = 305000
0715: col_source_str_pyobj = 401100
0716: col_source_str_utf8_arrow = 402000
0717: col_source_str_i8_cat = 403000
0718: col_source_str_i16_cat = 404000
0719: col_source_str_i32_cat = 405000
0720: col_source_str_lrg_utf8_arrow = 406000
0721: col_source_dt64ns_numpy = 501000
0722: col_source_dt64ns_tz_arrow = 502000
0723: col_source_dt64us_numpy = 601000
0724: col_source_dt64us_tz_arrow = 602000
0725: # Designated-`at` only (columnar): widened to micros in Rust by the
0726: # millis/seconds designated-timestamp FFI.
0727: col_source_dt64ms_tz_arrow = 603000
0728: col_source_dt64s_tz_arrow = 604000
0729: col_source_arr_f64_numpyobj = 701100
0730: col_source_decimal_pyobj = 801100
0731: col_source_decimal32_arrow = 802000
0732: col_source_decimal64_arrow = 803000
0733: col_source_decimal128_arrow = 804000
0734: col_source_decimal256_arrow = 805000
0735: # `arrow.uuid`-labeled FixedSizeBinary(16) — the canonical Arrow
0736: # shape egress emits for UUID columns. The label is what claims the
0737: # column as UUID: this planner refuses an unlabelled 16-byte column
0738: # (see `_dataframe_series_resolve_arrow`). Column-QWP only; row-ILP
0739: # has no serializer for this source.
0740: col_source_fsb16_arrow = 901000
0741: # A bare 16- or 32-byte FixedSizeBinary column whose round-trip
0742: # claim names UUID or LONG256, the width matching the kind. The
0743: # claim is the label the column itself lacks, so the width alone
0744: # decides the wire type, and the value buffer goes out as it is.
0745: # `_dataframe_normalize_claimed_arrow` explains which such columns
0746: # reach the planner in this shape. Column-QWP only.
0747: col_source_fsb_claimed_arrow = 902000
0748: # PyObject sniff outputs for QuestDB-specific wire kinds.
0749: col_source_uuid_pyobj = 903100
0750: col_source_ipv4_pyobj = 904100
0751: col_source_datetime_pyobj = 905100
0752: col_source_bytes_pyobj = 906100
0753: col_source_arrow_passthrough = 1000000
0754:
0755:
+0756: cdef bint col_source_needs_gil(col_source_t source) noexcept nogil:
static int __pyx_f_7questdb_7_client_col_source_needs_gil(enum __pyx_t_7questdb_7_client_col_source_t __pyx_v_source) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
0757: # Check if hundreds digit is 1.
+0758: return <int>source // 100 % 10 == 1
{
__pyx_r = (__Pyx_mod_long(__Pyx_div_long(((int)__pyx_v_source), 0x64, 1), 10, 1) == 1);
}
goto __pyx_L0;
0759:
0760:
0761: cdef set _STR_SOURCES = {
+0762: col_source_t.col_source_str_pyobj,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0763: col_source_t.col_source_str_utf8_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0764: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0765: col_source_t.col_source_str_i8_cat,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0766: col_source_t.col_source_str_i16_cat,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0767: col_source_t.col_source_str_i32_cat,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PySet_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PySet_Add(__pyx_t_16, __pyx_t_4) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_5) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_13) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_11) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_14) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_15) < (0)) __PYX_ERR(2, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__STR_SOURCES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__STR_SOURCES, ((PyObject*)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0;
0768: }
0769:
0770:
0771: cdef dict _PYOBJ_SOURCE_DESCR = {
+0772: col_source_t.col_source_bool_pyobj: "bool",
__pyx_t_16 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0773: col_source_t.col_source_int_pyobj: "int",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_int_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0774: col_source_t.col_source_float_pyobj: "float",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_float_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0775: col_source_t.col_source_str_pyobj: "str",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0776: col_source_t.col_source_decimal_pyobj: "Decimal",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_Decimal) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0777: col_source_t.col_source_uuid_pyobj: "UUID",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_UUID) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0778: col_source_t.col_source_ipv4_pyobj: "IPv4Address",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_IPv4Address) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0779: col_source_t.col_source_datetime_pyobj: "datetime",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_n_u_datetime) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0780: col_source_t.col_source_bytes_pyobj: "bytes/bytearray/memoryview",
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); if (PyDict_SetItem(__pyx_t_16, __pyx_t_15, __pyx_mstate_global->__pyx_kp_u_bytes_bytearray_memoryview) < (0)) __PYX_ERR(2, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, ((PyObject*)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0;
0781: }
0782:
0783:
0784: # Object-column sources only the columnar `QuestDB.dataframe()` path can ingest;
0785: # the row-oriented `Sender.dataframe()` has no ILP target for them.
+0786: cdef frozenset _COLUMNAR_ONLY_PYOBJ_SOURCES = frozenset((
{
PyObject* const __pyx_temp[] = {__pyx_t_16, __pyx_t_15, __pyx_t_14};
__pyx_t_11 = __Pyx_PyFrozenSet_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 786, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XGOTREF(__pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES);
__Pyx_DECREF_SET(__pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES, ((PyObject*)__pyx_t_11));
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
+0787: col_source_t.col_source_uuid_pyobj,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0788: col_source_t.col_source_ipv4_pyobj,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0789: col_source_t.col_source_bytes_pyobj,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
0790: ))
0791:
0792:
0793: # Compatibility matrix for the Python dataframe planner. `QuestDB.dataframe()`
0794: # uses the Rust Arrow RecordBatch route as the canonical Arrow policy when its
0795: # public routing constraints are satisfied.
0796: cdef dict _TARGET_TO_SOURCES = {
+0797: col_target_t.col_target_skip: {
__pyx_t_11 = __Pyx_PyDict_NewPresized(19); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0798: col_source_t.col_source_nulls,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_nulls); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = PySet_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PySet_Add(__pyx_t_16, __pyx_t_15) < (0)) __PYX_ERR(2, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_14, __pyx_t_16) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
0799: },
+0800: col_target_t.col_target_table: {
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0801: col_source_t.col_source_str_pyobj,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0802: col_source_t.col_source_str_utf8_arrow,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0803: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0804: col_source_t.col_source_str_i8_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0805: col_source_t.col_source_str_i16_cat,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0806: col_source_t.col_source_str_i32_cat,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18 = PySet_New(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); if (PySet_Add(__pyx_t_18, __pyx_t_14) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PySet_Add(__pyx_t_18, __pyx_t_15) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PySet_Add(__pyx_t_18, __pyx_t_13) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_18, __pyx_t_5) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_18, __pyx_t_4) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_18, __pyx_t_17) < (0)) __PYX_ERR(2, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_16, __pyx_t_18) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
0807: },
+0808: col_target_t.col_target_symbol: {
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0809: col_source_t.col_source_str_pyobj,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0810: col_source_t.col_source_str_utf8_arrow,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
+0811: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0812: col_source_t.col_source_str_i8_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0813: col_source_t.col_source_str_i16_cat,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0814: col_source_t.col_source_str_i32_cat,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_14 = PySet_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); if (PySet_Add(__pyx_t_14, __pyx_t_16) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_17) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_4) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_5) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_13) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_14, __pyx_t_15) < (0)) __PYX_ERR(2, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_18, __pyx_t_14) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
0815: },
+0816: col_target_t.col_target_column_bool: {
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0817: col_source_t.col_source_bool_pyobj,
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_pyobj); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0818: col_source_t.col_source_bool_numpy,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_numpy); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0819: col_source_t.col_source_bool_arrow,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bool_arrow); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PySet_Add(__pyx_t_5, __pyx_t_18) < (0)) __PYX_ERR(2, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PySet_Add(__pyx_t_5, __pyx_t_15) < (0)) __PYX_ERR(2, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PySet_Add(__pyx_t_5, __pyx_t_13) < (0)) __PYX_ERR(2, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_14, __pyx_t_5) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
0820: },
+0821: col_target_t.col_target_column_i64: {
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0822: col_source_t.col_source_int_pyobj,
__pyx_t_14 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_int_pyobj); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14);
+0823: col_source_t.col_source_u8_numpy,
__pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u8_numpy); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13);
+0824: col_source_t.col_source_i8_numpy,
__pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_numpy); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15);
+0825: col_source_t.col_source_u16_numpy,
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u16_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0826: col_source_t.col_source_i16_numpy,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0827: col_source_t.col_source_u32_numpy,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u32_numpy); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
+0828: col_source_t.col_source_i32_numpy,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_numpy); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0829: col_source_t.col_source_u64_numpy,
__pyx_t_19 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u64_numpy); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19);
+0830: col_source_t.col_source_i64_numpy,
__pyx_t_20 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i64_numpy); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20);
+0831: col_source_t.col_source_u8_arrow,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u8_arrow); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0832: col_source_t.col_source_i8_arrow,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_arrow); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0833: col_source_t.col_source_u16_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u16_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0834: col_source_t.col_source_i16_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0835: col_source_t.col_source_u32_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u32_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0836: col_source_t.col_source_i32_arrow,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_arrow); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0837: col_source_t.col_source_u64_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_u64_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0838: col_source_t.col_source_i64_arrow,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i64_arrow); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28); __pyx_t_29 = PySet_New(0); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); if (PySet_Add(__pyx_t_29, __pyx_t_14) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_13) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_15) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_18) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_4) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_17) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_16) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_19) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_20) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_21) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_22) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_23) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_24) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_25) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_26) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_27) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_29, __pyx_t_28) < (0)) __PYX_ERR(2, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_5, __pyx_t_29) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
0839: },
+0840: col_target_t.col_target_column_f64: {
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
+0841: col_source_t.col_source_float_pyobj,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_float_pyobj); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0842: col_source_t.col_source_f32_numpy,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_numpy); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
+0843: col_source_t.col_source_f64_numpy,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f64_numpy); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0844: col_source_t.col_source_f32_arrow,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_arrow); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0845: col_source_t.col_source_f64_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f64_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_5) < (0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_28) < (0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_26) < (0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_29, __pyx_t_24) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0846: },
+0847: col_target_t.col_target_column_i8: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0848: col_source_t.col_source_i8_arrow,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i8_arrow); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_25 = PySet_New(0); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); if (PySet_Add(__pyx_t_25, __pyx_t_29) < (0)) __PYX_ERR(2, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
0849: },
+0850: col_target_t.col_target_column_i16: {
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0851: col_source_t.col_source_i16_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i16_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_29 = PySet_New(0); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); if (PySet_Add(__pyx_t_29, __pyx_t_24) < (0)) __PYX_ERR(2, 851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_25, __pyx_t_29) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
0852: },
+0853: col_target_t.col_target_column_i32: {
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
+0854: col_source_t.col_source_i32_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_i32_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_29, __pyx_t_24) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0855: },
+0856: col_target_t.col_target_column_f32: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0857: col_source_t.col_source_f32_arrow,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_f32_arrow); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_25 = PySet_New(0); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); if (PySet_Add(__pyx_t_25, __pyx_t_29) < (0)) __PYX_ERR(2, 857, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
0858: },
+0859: col_target_t.col_target_column_uuid: {
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0860: col_source_t.col_source_fsb16_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_fsb16_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0861: col_source_t.col_source_uuid_pyobj,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_uuid_pyobj); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_26 = PySet_New(0); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); if (PySet_Add(__pyx_t_26, __pyx_t_24) < (0)) __PYX_ERR(2, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_26, __pyx_t_29) < (0)) __PYX_ERR(2, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_25, __pyx_t_26) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
0862: },
+0863: col_target_t.col_target_column_binary: {
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0864: col_source_t.col_source_bytes_pyobj,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_bytes_pyobj); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0865: col_source_t.col_source_fsb_claimed_arrow,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_fsb_claimed_arrow); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_29) < (0)) __PYX_ERR(2, 864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_26, __pyx_t_24) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0866: },
+0867: col_target_t.col_target_column_arrow: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0868: col_source_t.col_source_arrow_passthrough,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_arrow_passthrough); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); __pyx_t_29 = PySet_New(0); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); if (PySet_Add(__pyx_t_29, __pyx_t_26) < (0)) __PYX_ERR(2, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_24, __pyx_t_29) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
0869: },
0870: # The Rust Arrow path treats UInt32 as IPV4 only when Arrow field
0871: # metadata says questdb.column_type=ipv4. Pandas drops Arrow field
0872: # metadata before it reaches this planner, so plain UInt32 must
0873: # resolve through col_target_column_i64 instead.
+0874: col_target_t.col_target_column_ipv4: {
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
+0875: col_source_t.col_source_ipv4_pyobj,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_ipv4_pyobj); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_26 = PySet_New(0); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); if (PySet_Add(__pyx_t_26, __pyx_t_24) < (0)) __PYX_ERR(2, 875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_29, __pyx_t_26) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
0876: },
+0877: col_target_t.col_target_column_str: {
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0878: col_source_t.col_source_str_pyobj,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_pyobj); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
+0879: col_source_t.col_source_str_utf8_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_utf8_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0880: col_source_t.col_source_str_lrg_utf8_arrow,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0881: col_source_t.col_source_str_i8_cat,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i8_cat); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0882: col_source_t.col_source_str_i16_cat,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i16_cat); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
+0883: col_source_t.col_source_str_i32_cat,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_str_i32_cat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_23 = PySet_New(0); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); if (PySet_Add(__pyx_t_23, __pyx_t_29) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_24) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_25) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_27) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_28) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PySet_Add(__pyx_t_23, __pyx_t_5) < (0)) __PYX_ERR(2, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_26, __pyx_t_23) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
0884: },
+0885: col_target_t.col_target_column_ts: {
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0886: col_source_t.col_source_dt64ns_numpy,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_numpy); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0887: col_source_t.col_source_dt64ns_tz_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0888: col_source_t.col_source_dt64us_numpy,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_numpy); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
+0889: col_source_t.col_source_dt64us_tz_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0890: col_source_t.col_source_datetime_pyobj,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); __pyx_t_24 = PySet_New(0); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24); if (PySet_Add(__pyx_t_24, __pyx_t_26) < (0)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_5) < (0)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_28) < (0)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_27) < (0)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_23, __pyx_t_24) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
0891: },
+0892: col_target_t.col_target_column_arr_f64: {
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0893: col_source_t.col_source_arr_f64_numpyobj,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_25 = PySet_New(0); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25); if (PySet_Add(__pyx_t_25, __pyx_t_23) < (0)) __PYX_ERR(2, 893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_24, __pyx_t_25) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
0894: },
+0895: col_target_t.col_target_column_decimal: {
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0896: col_source_t.col_source_decimal_pyobj,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal_pyobj); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0897: col_source_t.col_source_decimal32_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal32_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0898: col_source_t.col_source_decimal64_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal64_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0899: col_source_t.col_source_decimal128_arrow,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal128_arrow); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
+0900: col_source_t.col_source_decimal256_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_decimal256_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_26 = PySet_New(0); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26); if (PySet_Add(__pyx_t_26, __pyx_t_24) < (0)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_26, __pyx_t_23) < (0)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_26, __pyx_t_27) < (0)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_26, __pyx_t_28) < (0)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PySet_Add(__pyx_t_26, __pyx_t_5) < (0)) __PYX_ERR(2, 896, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_25, __pyx_t_26) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
0901: },
+0902: col_target_t.col_target_at: {
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0903: col_source_t.col_source_dt64ns_numpy,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_numpy); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0904: col_source_t.col_source_dt64ns_tz_arrow,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+0905: col_source_t.col_source_dt64us_numpy,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_numpy); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
+0906: col_source_t.col_source_dt64us_tz_arrow,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0907: col_source_t.col_source_dt64ms_tz_arrow,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0908: col_source_t.col_source_dt64s_tz_arrow,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0909: col_source_t.col_source_datetime_pyobj,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_e_7questdb_7_client_col_source_datetime_pyobj); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_22 = PySet_New(0); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); if (PySet_Add(__pyx_t_22, __pyx_t_25) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_5) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_28) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_27) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_23) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_24) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (PySet_Add(__pyx_t_22, __pyx_t_29) < (0)) __PYX_ERR(2, 903, __pyx_L1_error) __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; if (PyDict_SetItem(__pyx_t_11, __pyx_t_26, __pyx_t_22) < (0)) __PYX_ERR(2, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, ((PyObject*)__pyx_t_11)); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0;
0910: },
0911: }
0912:
0913:
0914: # Field-target orderings used by `_dataframe_resolve_target` — each
0915: # protocol passes its own ordering so the resolver picks the right
0916: # target on the first hit.
0917: #
0918: # Many Arrow sources sit in multiple targets' source-sets
0919: # (`_TARGET_TO_SOURCES`) on purpose, e.g. `col_source_i8_arrow` lives
0920: # in both `col_target_column_i64` (so row-ILP can serialize it as
0921: # text via the existing i64 dispatch) and `col_target_column_i8` (so
0922: # column-QWP can send it as a BYTE wire type). The two `_FIELD_TARGETS_*`
0923: # tuples disambiguate: row-ILP lists wide targets only; column-QWP
0924: # lists narrow targets first so they win the resolver loop.
0925:
0926: cdef tuple _FIELD_TARGETS_ROW = (
+0927: col_target_t.col_target_skip,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); /* … */ { PyObject* __pyx_temp[8] = {__pyx_t_11, __pyx_t_22, __pyx_t_26, __pyx_t_29, __pyx_t_24, __pyx_t_23, __pyx_t_27, __pyx_t_28}; __pyx_t_5 = __Pyx_PyTuple_FromArray(__pyx_temp, 8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__FIELD_TARGETS_ROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__FIELD_TARGETS_ROW, ((PyObject*)__pyx_t_5)); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0;
+0928: col_target_t.col_target_column_bool,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0929: col_target_t.col_target_column_i64,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0930: col_target_t.col_target_column_f64,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
+0931: col_target_t.col_target_column_str,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0932: col_target_t.col_target_column_ts,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0933: col_target_t.col_target_column_arr_f64,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0934: col_target_t.col_target_column_decimal)
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
0935:
0936: cdef tuple _FIELD_TARGETS_QWP = (
+0937: col_target_t.col_target_skip,
__pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_skip); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ { PyObject* __pyx_temp[16] = {__pyx_t_5, __pyx_t_28, __pyx_t_27, __pyx_t_23, __pyx_t_24, __pyx_t_29, __pyx_t_26, __pyx_t_22, __pyx_t_11, __pyx_t_25, __pyx_t_21, __pyx_t_20, __pyx_t_19, __pyx_t_16, __pyx_t_17, __pyx_t_4}; __pyx_t_18 = __Pyx_PyTuple_FromArray(__pyx_temp, 16); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__FIELD_TARGETS_QWP); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__FIELD_TARGETS_QWP, ((PyObject*)__pyx_t_18)); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = 0;
+0938: col_target_t.col_target_column_bool,
__pyx_t_28 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_bool); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_28);
0939: # Narrow numeric targets first — they own the Arrow narrow
0940: # sources (`i8_arrow`, `f32_arrow`, …) so column-QWP emits the
0941: # corresponding narrow wire types (BYTE / SHORT / INT / FLOAT)
0942: # instead of widening to LONG / DOUBLE.
+0943: col_target_t.col_target_column_i8,
__pyx_t_27 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i8); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_27);
+0944: col_target_t.col_target_column_i16,
__pyx_t_23 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i16); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23);
+0945: col_target_t.col_target_column_i32,
__pyx_t_24 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i32); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_24);
+0946: col_target_t.col_target_column_i64,
__pyx_t_29 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_i64); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_29);
0947: # IPV4 remains a column-QWP target for the wire emitter, but this
0948: # pandas planner has no metadata-preserving UInt32 source that can
0949: # select it. Metadata-aware IPV4 routing belongs to the Rust Arrow
0950: # ingestion path.
+0951: col_target_t.col_target_column_ipv4,
__pyx_t_26 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ipv4); if (unlikely(!__pyx_t_26)) __PYX_ERR(2, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_26);
+0952: col_target_t.col_target_column_f32,
__pyx_t_22 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f32); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22);
+0953: col_target_t.col_target_column_f64,
__pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_f64); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11);
+0954: col_target_t.col_target_column_str,
__pyx_t_25 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_str); if (unlikely(!__pyx_t_25)) __PYX_ERR(2, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_25);
+0955: col_target_t.col_target_column_ts,
__pyx_t_21 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_ts); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21);
+0956: col_target_t.col_target_column_arr_f64,
__pyx_t_20 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arr_f64); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20);
+0957: col_target_t.col_target_column_decimal,
__pyx_t_19 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_decimal); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19);
0958: # QuestDB-extension types whose Arrow source is unique
0959: # (`arrow.uuid`-labeled FixedSizeBinary(16)). LONG256 is absent: no
0960: # pandas column states it by its own type, since pyarrow drops the
0961: # `questdb.column_type=long256` field metadata when it exports a
0962: # single column, so nothing here could select that target. A
0963: # `df.attrs['questdb']` LONG256 claim reaches the wire through
0964: # `col_target_column_binary`, whose source or override names the
0965: # 32-byte encoding, and an unclaimed 32-byte column is refused
0966: # rather than sent as opaque bytes.
+0967: col_target_t.col_target_column_uuid,
__pyx_t_16 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_uuid); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16);
+0968: col_target_t.col_target_column_binary,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_binary); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17);
+0969: col_target_t.col_target_column_arrow)
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_column_arrow); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
0970:
0971:
0972: # Targets that map directly from a meta target.
0973: cdef set _DIRECT_META_TARGETS = {
+0974: col_target_t.col_target_table,
__pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_table); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18);
+0975: col_target_t.col_target_symbol,
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4);
+0976: col_target_t.col_target_at,
__pyx_t_17 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_e_7questdb_7_client_col_target_at); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_16 = PySet_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PySet_Add(__pyx_t_16, __pyx_t_18) < (0)) __PYX_ERR(2, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_4) < (0)) __PYX_ERR(2, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PySet_Add(__pyx_t_16, __pyx_t_17) < (0)) __PYX_ERR(2, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS, ((PyObject*)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0;
0977: }
0978:
0979:
0980: # This is verbose, but..
0981: # * Enums give us constants.
0982: # * Constants allow unfolding `if` statements into `switch`
0983: # * Switch statements can be more heavily optimized by the C compiler.
+0984: cdef enum col_dispatch_code_t:
enum __pyx_t_7questdb_7_client_col_dispatch_code_t {
0985: col_dispatch_code_skip_nulls = \
0986: col_target_t.col_target_skip + col_source_t.col_source_nulls
0987:
0988: col_dispatch_code_table__str_pyobj = \
0989: col_target_t.col_target_table + col_source_t.col_source_str_pyobj
0990: col_dispatch_code_table__str_utf8_arrow = \
0991: col_target_t.col_target_table + col_source_t.col_source_str_utf8_arrow
0992: col_dispatch_code_table__str_lrg_utf8_arrow = \
0993: col_target_t.col_target_table + col_source_t.col_source_str_lrg_utf8_arrow
0994: col_dispatch_code_table__str_i8_cat = \
0995: col_target_t.col_target_table + col_source_t.col_source_str_i8_cat
0996: col_dispatch_code_table__str_i16_cat = \
0997: col_target_t.col_target_table + col_source_t.col_source_str_i16_cat
0998: col_dispatch_code_table__str_i32_cat = \
0999: col_target_t.col_target_table + col_source_t.col_source_str_i32_cat
1000:
1001: col_dispatch_code_symbol__str_pyobj = \
1002: col_target_t.col_target_symbol + col_source_t.col_source_str_pyobj
1003: col_dispatch_code_symbol__str_utf8_arrow = \
1004: col_target_t.col_target_symbol + col_source_t.col_source_str_utf8_arrow
1005: col_dispatch_code_symbol__str_lrg_utf8_arrow = \
1006: col_target_t.col_target_symbol + col_source_t.col_source_str_lrg_utf8_arrow
1007: col_dispatch_code_symbol__str_i8_cat = \
1008: col_target_t.col_target_symbol + col_source_t.col_source_str_i8_cat
1009: col_dispatch_code_symbol__str_i16_cat = \
1010: col_target_t.col_target_symbol + col_source_t.col_source_str_i16_cat
1011: col_dispatch_code_symbol__str_i32_cat = \
1012: col_target_t.col_target_symbol + col_source_t.col_source_str_i32_cat
1013:
1014: col_dispatch_code_column_bool__bool_pyobj = \
1015: col_target_t.col_target_column_bool + col_source_t.col_source_bool_pyobj
1016: col_dispatch_code_column_bool__bool_numpy = \
1017: col_target_t.col_target_column_bool + col_source_t.col_source_bool_numpy
1018: col_dispatch_code_column_bool__bool_arrow = \
1019: col_target_t.col_target_column_bool + col_source_t.col_source_bool_arrow
1020:
1021: col_dispatch_code_column_i64__int_pyobj = \
1022: col_target_t.col_target_column_i64 + col_source_t.col_source_int_pyobj
1023: col_dispatch_code_column_i64__u8_numpy = \
1024: col_target_t.col_target_column_i64 + col_source_t.col_source_u8_numpy
1025: col_dispatch_code_column_i64__i8_numpy = \
1026: col_target_t.col_target_column_i64 + col_source_t.col_source_i8_numpy
1027: col_dispatch_code_column_i64__u16_numpy = \
1028: col_target_t.col_target_column_i64 + col_source_t.col_source_u16_numpy
1029: col_dispatch_code_column_i64__i16_numpy = \
1030: col_target_t.col_target_column_i64 + col_source_t.col_source_i16_numpy
1031: col_dispatch_code_column_i64__u32_numpy = \
1032: col_target_t.col_target_column_i64 + col_source_t.col_source_u32_numpy
1033: col_dispatch_code_column_i64__i32_numpy = \
1034: col_target_t.col_target_column_i64 + col_source_t.col_source_i32_numpy
1035: col_dispatch_code_column_i64__u64_numpy = \
1036: col_target_t.col_target_column_i64 + col_source_t.col_source_u64_numpy
1037: col_dispatch_code_column_i64__i64_numpy = \
1038: col_target_t.col_target_column_i64 + col_source_t.col_source_i64_numpy
1039: col_dispatch_code_column_i64__u8_arrow = \
1040: col_target_t.col_target_column_i64 + col_source_t.col_source_u8_arrow
1041: col_dispatch_code_column_i64__i8_arrow = \
1042: col_target_t.col_target_column_i64 + col_source_t.col_source_i8_arrow
1043: col_dispatch_code_column_i64__u16_arrow = \
1044: col_target_t.col_target_column_i64 + col_source_t.col_source_u16_arrow
1045: col_dispatch_code_column_i64__i16_arrow = \
1046: col_target_t.col_target_column_i64 + col_source_t.col_source_i16_arrow
1047: col_dispatch_code_column_i64__u32_arrow = \
1048: col_target_t.col_target_column_i64 + col_source_t.col_source_u32_arrow
1049: col_dispatch_code_column_i64__i32_arrow = \
1050: col_target_t.col_target_column_i64 + col_source_t.col_source_i32_arrow
1051: col_dispatch_code_column_i64__u64_arrow = \
1052: col_target_t.col_target_column_i64 + col_source_t.col_source_u64_arrow
1053: col_dispatch_code_column_i64__i64_arrow = \
1054: col_target_t.col_target_column_i64 + col_source_t.col_source_i64_arrow
1055:
1056: col_dispatch_code_column_f64__float_pyobj = \
1057: col_target_t.col_target_column_f64 + col_source_t.col_source_float_pyobj
1058: col_dispatch_code_column_f64__f32_numpy = \
1059: col_target_t.col_target_column_f64 + col_source_t.col_source_f32_numpy
1060: col_dispatch_code_column_f64__f64_numpy = \
1061: col_target_t.col_target_column_f64 + col_source_t.col_source_f64_numpy
1062: col_dispatch_code_column_f64__f32_arrow = \
1063: col_target_t.col_target_column_f64 + col_source_t.col_source_f32_arrow
1064: col_dispatch_code_column_f64__f64_arrow = \
1065: col_target_t.col_target_column_f64 + col_source_t.col_source_f64_arrow
1066:
1067: col_dispatch_code_column_str__str_pyobj = \
1068: col_target_t.col_target_column_str + col_source_t.col_source_str_pyobj
1069: col_dispatch_code_column_str__str_utf8_arrow = \
1070: col_target_t.col_target_column_str + col_source_t.col_source_str_utf8_arrow
1071: col_dispatch_code_column_str__str_lrg_utf8_arrow = \
1072: col_target_t.col_target_column_str + col_source_t.col_source_str_lrg_utf8_arrow
1073: col_dispatch_code_column_str__str_i8_cat = \
1074: col_target_t.col_target_column_str + col_source_t.col_source_str_i8_cat
1075: col_dispatch_code_column_str__str_i16_cat = \
1076: col_target_t.col_target_column_str + col_source_t.col_source_str_i16_cat
1077: col_dispatch_code_column_str__str_i32_cat = \
1078: col_target_t.col_target_column_str + col_source_t.col_source_str_i32_cat
1079:
1080: col_dispatch_code_column_ts__dt64ns_numpy = \
1081: col_target_t.col_target_column_ts + col_source_t.col_source_dt64ns_numpy
1082: col_dispatch_code_column_ts__dt64ns_tz_arrow = \
1083: col_target_t.col_target_column_ts + \
1084: col_source_t.col_source_dt64ns_tz_arrow
1085:
1086: col_dispatch_code_column_ts__dt64us_numpy = \
1087: col_target_t.col_target_column_ts + col_source_t.col_source_dt64us_numpy
1088: col_dispatch_code_column_ts__dt64us_tz_arrow = \
1089: col_target_t.col_target_column_ts + \
1090: col_source_t.col_source_dt64us_tz_arrow
1091:
1092: col_dispatch_code_at__dt64ns_numpy = \
1093: col_target_t.col_target_at + col_source_t.col_source_dt64ns_numpy
1094: col_dispatch_code_at__dt64ns_tz_arrow = \
1095: col_target_t.col_target_at + col_source_t.col_source_dt64ns_tz_arrow
1096:
1097: col_dispatch_code_at__dt64us_numpy = \
1098: col_target_t.col_target_at + col_source_t.col_source_dt64us_numpy
1099: col_dispatch_code_at__dt64us_tz_arrow = \
1100: col_target_t.col_target_at + col_source_t.col_source_dt64us_tz_arrow
1101:
1102: col_dispatch_code_column_arr_f64__arr_f64_numpyobj = \
1103: col_target_t.col_target_column_arr_f64 + col_source_t.col_source_arr_f64_numpyobj
1104:
1105: col_dispatch_code_column_decimal__decimal_pyobj = \
1106: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal_pyobj
1107: col_dispatch_code_column_decimal__decimal32_arrow = \
1108: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal32_arrow
1109: col_dispatch_code_column_decimal__decimal64_arrow = \
1110: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal64_arrow
1111: col_dispatch_code_column_decimal__decimal128_arrow = \
1112: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal128_arrow
1113: col_dispatch_code_column_decimal__decimal256_arrow = \
1114: col_target_t.col_target_column_decimal + col_source_t.col_source_decimal256_arrow
1115:
1116: col_dispatch_code_column_i8__i8_arrow = \
1117: col_target_t.col_target_column_i8 + col_source_t.col_source_i8_arrow
1118: col_dispatch_code_column_i16__i16_arrow = \
1119: col_target_t.col_target_column_i16 + col_source_t.col_source_i16_arrow
1120: col_dispatch_code_column_i32__i32_arrow = \
1121: col_target_t.col_target_column_i32 + col_source_t.col_source_i32_arrow
1122: col_dispatch_code_column_f32__f32_arrow = \
1123: col_target_t.col_target_column_f32 + col_source_t.col_source_f32_arrow
1124: col_dispatch_code_column_uuid__fsb16_arrow = \
1125: col_target_t.col_target_column_uuid + col_source_t.col_source_fsb16_arrow
1126: col_dispatch_code_column_uuid__uuid_pyobj = \
1127: col_target_t.col_target_column_uuid + col_source_t.col_source_uuid_pyobj
1128: col_dispatch_code_column_ipv4__u32_arrow = \
1129: col_target_t.col_target_column_ipv4 + col_source_t.col_source_u32_arrow
1130: col_dispatch_code_column_ipv4__ipv4_pyobj = \
1131: col_target_t.col_target_column_ipv4 + col_source_t.col_source_ipv4_pyobj
1132: col_dispatch_code_column_ts__datetime_pyobj = \
1133: col_target_t.col_target_column_ts + col_source_t.col_source_datetime_pyobj
1134: col_dispatch_code_at__datetime_pyobj = \
1135: col_target_t.col_target_at + col_source_t.col_source_datetime_pyobj
1136: col_dispatch_code_column_binary__bytes_pyobj = \
1137: col_target_t.col_target_column_binary + col_source_t.col_source_bytes_pyobj
1138: col_dispatch_code_column_binary__fsb_claimed_arrow = \
+1139: col_target_t.col_target_column_binary + col_source_t.col_source_fsb_claimed_arrow
__pyx_e_7questdb_7_client_col_dispatch_code_skip_nulls = (__pyx_e_7questdb_7_client_col_target_skip + __pyx_e_7questdb_7_client_col_source_nulls), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_pyobj = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_table + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_pyobj = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_symbol + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_pyobj = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_numpy = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_arrow = (__pyx_e_7questdb_7_client_col_target_column_bool + __pyx_e_7questdb_7_client_col_source_bool_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__int_pyobj = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_int_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u8_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i8_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u16_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i16_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_numpy = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_u64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_arrow = (__pyx_e_7questdb_7_client_col_target_column_i64 + __pyx_e_7questdb_7_client_col_source_i64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__float_pyobj = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_float_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_numpy = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f32_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_numpy = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f64_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_arrow = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_arrow = (__pyx_e_7questdb_7_client_col_target_column_f64 + __pyx_e_7questdb_7_client_col_source_f64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_pyobj = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_lrg_utf8_arrow = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i8_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i8_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i16_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i16_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i32_cat = (__pyx_e_7questdb_7_client_col_target_column_str + __pyx_e_7questdb_7_client_col_source_str_i32_cat), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_numpy = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64ns_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_tz_arrow = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_numpy = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64us_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_tz_arrow = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_numpy = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64ns_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_tz_arrow = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_numpy = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64us_numpy), __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_tz_arrow = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_arr_f64__arr_f64_numpyobj = (__pyx_e_7questdb_7_client_col_target_column_arr_f64 + __pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal_pyobj = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal32_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal64_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal64_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal128_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal128_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal256_arrow = (__pyx_e_7questdb_7_client_col_target_column_decimal + __pyx_e_7questdb_7_client_col_source_decimal256_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i8__i8_arrow = (__pyx_e_7questdb_7_client_col_target_column_i8 + __pyx_e_7questdb_7_client_col_source_i8_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i16__i16_arrow = (__pyx_e_7questdb_7_client_col_target_column_i16 + __pyx_e_7questdb_7_client_col_source_i16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_i32__i32_arrow = (__pyx_e_7questdb_7_client_col_target_column_i32 + __pyx_e_7questdb_7_client_col_source_i32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_f32__f32_arrow = (__pyx_e_7questdb_7_client_col_target_column_f32 + __pyx_e_7questdb_7_client_col_source_f32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_uuid__fsb16_arrow = (__pyx_e_7questdb_7_client_col_target_column_uuid + __pyx_e_7questdb_7_client_col_source_fsb16_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_uuid__uuid_pyobj = (__pyx_e_7questdb_7_client_col_target_column_uuid + __pyx_e_7questdb_7_client_col_source_uuid_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_ipv4__u32_arrow = (__pyx_e_7questdb_7_client_col_target_column_ipv4 + __pyx_e_7questdb_7_client_col_source_u32_arrow), __pyx_e_7questdb_7_client_col_dispatch_code_column_ipv4__ipv4_pyobj = (__pyx_e_7questdb_7_client_col_target_column_ipv4 + __pyx_e_7questdb_7_client_col_source_ipv4_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__datetime_pyobj = (__pyx_e_7questdb_7_client_col_target_column_ts + __pyx_e_7questdb_7_client_col_source_datetime_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_at__datetime_pyobj = (__pyx_e_7questdb_7_client_col_target_at + __pyx_e_7questdb_7_client_col_source_datetime_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_binary__bytes_pyobj = (__pyx_e_7questdb_7_client_col_target_column_binary + __pyx_e_7questdb_7_client_col_source_bytes_pyobj), __pyx_e_7questdb_7_client_col_dispatch_code_column_binary__fsb_claimed_arrow = (__pyx_e_7questdb_7_client_col_target_column_binary + __pyx_e_7questdb_7_client_col_source_fsb_claimed_arrow) };
1140:
1141:
1142: # Int values in order for sorting (as needed for API's sequential coupling).
+1143: cdef enum meta_target_t:
enum __pyx_t_7questdb_7_client_meta_target_t {
1144: meta_target_table = <int>col_target_t.col_target_table
1145: meta_target_symbol = <int>col_target_t.col_target_symbol
1146: meta_target_field = <int>col_target_t.col_target_column_bool
+1147: meta_target_at = <int>col_target_t.col_target_at
__pyx_e_7questdb_7_client_meta_target_table = ((int)__pyx_e_7questdb_7_client_col_target_table), __pyx_e_7questdb_7_client_meta_target_symbol = ((int)__pyx_e_7questdb_7_client_col_target_symbol), __pyx_e_7questdb_7_client_meta_target_field = ((int)__pyx_e_7questdb_7_client_col_target_column_bool), __pyx_e_7questdb_7_client_meta_target_at = ((int)__pyx_e_7questdb_7_client_col_target_at) };
1148:
1149:
+1150: cdef struct col_setup_t:
struct __pyx_t_7questdb_7_client_col_setup_t {
struct __pyx_t_7questdb_7_client_col_chunks_t chunks;
size_t orig_index;
Py_buffer pybuf;
struct ArrowSchema arrow_schema;
struct qwp_arrow_import *arrow_import;
enum __pyx_t_7questdb_7_client_col_source_t source;
enum __pyx_t_7questdb_7_client_meta_target_t meta_target;
enum __pyx_t_7questdb_7_client_col_target_t target;
int has_override;
enum qwp_numpy_dtype override_dtype;
uint8_t override_geohash_bits;
int nat_scan_done;
int nat_found;
};
1151: col_chunks_t chunks
1152: size_t orig_index
1153: Py_buffer pybuf
1154: ArrowSchema arrow_schema # Schema of first chunk.
1155: qwp_arrow_import* arrow_import
1156: col_source_t source
1157: meta_target_t meta_target
1158: col_target_t target
1159: bint has_override
1160: qwp_numpy_dtype override_dtype
1161: uint8_t override_geohash_bits
1162: bint nat_scan_done
1163: bint nat_found
1164:
1165:
+1166: cdef struct col_t:
struct __pyx_t_7questdb_7_client_col_t {
enum __pyx_t_7questdb_7_client_col_dispatch_code_t dispatch_code;
struct line_sender_column_name name;
struct __pyx_t_7questdb_7_client_col_cursor_t cursor;
struct __pyx_t_7questdb_7_client_col_setup_t *setup;
uint8_t scale;
};
1167: col_dispatch_code_t dispatch_code # source + target. Determines serializer.
1168: line_sender_column_name name
1169: col_cursor_t cursor
1170: col_setup_t* setup # Grouping to reduce size of struct.
1171: uint8_t scale # For arrow decimal types only, else 0.
1172:
1173:
+1174: cdef void col_t_release(col_t* col) noexcept:
static void __pyx_f_7questdb_7_client_col_t_release(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_chunk_index;
struct ArrowArray *__pyx_v_chunk;
/* … */
/* function exit code */
__pyx_L0:;
}
1175: """
1176: Release a (possibly) initialized column.
1177:
1178: col_t objects are `calloc`ed, so uninitialized (or partially) initialized
1179: objects will have their pointers and other values set to 0.
1180: """
1181: cdef size_t chunk_index
1182: cdef ArrowArray* chunk
1183:
+1184: if col.setup == NULL:
__pyx_t_1 = (__pyx_v_col->setup == NULL);
if (__pyx_t_1) {
/* … */
}
+1185: return
{
}
goto __pyx_L0;
1186:
+1187: if Py_buffer_obj_is_set(&col.setup.pybuf):
__pyx_t_1 = Py_buffer_obj_is_set((&__pyx_v_col->setup->pybuf));
if (__pyx_t_1) {
/* … */
}
+1188: PyBuffer_Release(&col.setup.pybuf) # Note: Sets `.pybuf.obj` to NULL.
PyBuffer_Release((&__pyx_v_col->setup->pybuf));
1189:
+1190: if col.setup.arrow_import != NULL:
__pyx_t_1 = (__pyx_v_col->setup->arrow_import != NULL);
if (__pyx_t_1) {
/* … */
}
+1191: qwp_arrow_import_free(col.setup.arrow_import)
qwp_arrow_import_free(__pyx_v_col->setup->arrow_import);
+1192: col.setup.arrow_import = NULL
__pyx_v_col->setup->arrow_import = NULL;
1193:
+1194: for chunk_index in range(col.setup.chunks.n_chunks):
__pyx_t_2 = __pyx_v_col->setup->chunks.n_chunks;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_chunk_index = __pyx_t_4;
+1195: chunk = &col.setup.chunks.chunks[chunk_index]
__pyx_v_chunk = (&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index]));
+1196: if chunk.release != NULL:
__pyx_t_1 = (__pyx_v_chunk->release != NULL);
if (__pyx_t_1) {
/* … */
}
+1197: chunk.release(chunk)
__pyx_v_chunk->release(__pyx_v_chunk);
+1198: memset(chunk, 0, sizeof(ArrowArray))
(void)(memset(__pyx_v_chunk, 0, (sizeof(struct ArrowArray)))); }
1199:
+1200: if col.setup.arrow_schema.release != NULL:
__pyx_t_1 = (__pyx_v_col->setup->arrow_schema.release != NULL);
if (__pyx_t_1) {
/* … */
}
+1201: col.setup.arrow_schema.release(&col.setup.arrow_schema)
__pyx_v_col->setup->arrow_schema.release((&__pyx_v_col->setup->arrow_schema));
1202:
+1203: free(col.setup.chunks.chunks)
free(__pyx_v_col->setup->chunks.chunks);
+1204: col.setup.chunks.chunks = NULL
__pyx_v_col->setup->chunks.chunks = NULL;
+1205: col.setup.chunks.n_chunks = 0
__pyx_v_col->setup->chunks.n_chunks = 0;
1206:
+1207: free(col.setup)
free(__pyx_v_col->setup);
+1208: col.setup = NULL
__pyx_v_col->setup = NULL;
1209:
1210:
1211: # Calloc'd array of col_t.
+1212: cdef struct col_t_arr:
struct __pyx_t_7questdb_7_client_col_t_arr {
size_t size;
struct __pyx_t_7questdb_7_client_col_t *d;
};
1213: size_t size
1214: col_t* d
1215:
1216:
1217: # Storage for one column's PyObject-sniffed, pre-built typed buffers.
1218: #
1219: # Lifetime is bound to the dataframe_plan_t that owns it. Buffers are
1220: # heap-allocated and freed in `pyobj_built_free`. The columnar emitter
1221: # accesses them via raw pointers (offsets / bytes / data / validity)
1222: # until the chunk flush completes.
+1223: cdef struct pyobj_built_t:
struct __pyx_t_7questdb_7_client_pyobj_built_t {
void *data;
int32_t *str_offsets;
uint8_t *str_bytes;
size_t str_bytes_len;
uint8_t *validity;
int has_nulls;
size_t row_count;
};
1224: # Per-source typed payload. Only one of these is set:
1225: # - str_pyobj : str_offsets + str_bytes
1226: # - int_pyobj : data (int64*)
1227: # - float_pyobj : data (double*)
1228: # - bool_pyobj : data (uint8* — LSB-packed Arrow bitmap, value bits)
1229: void* data
1230: int32_t* str_offsets # NULL except for str_pyobj
1231: uint8_t* str_bytes # NULL except for str_pyobj
1232: size_t str_bytes_len # bytes used (not capacity)
1233:
1234: # Validity bitmap (Arrow LSB-first). NULL when no nulls were seen.
1235: uint8_t* validity
1236: bint has_nulls
1237:
1238: size_t row_count
1239:
1240:
+1241: cdef struct dataframe_plan_t:
struct __pyx_t_7questdb_7_client_dataframe_plan_t {
size_t row_count;
size_t col_count;
struct line_sender_table_name c_table_name;
int64_t at_value;
struct __pyx_t_7questdb_7_client_col_t_arr cols;
int any_cols_need_gil;
struct qdb_pystr_pos str_buf_marker;
struct __pyx_t_7questdb_7_client_pyobj_built_t **pyobj_built;
};
1242: size_t row_count
1243: size_t col_count
1244: line_sender_table_name c_table_name
1245: int64_t at_value
1246: col_t_arr cols
1247: bint any_cols_need_gil
1248: qdb_pystr_pos str_buf_marker
1249: # Per-column pre-built PyObject buffers, indexed by col_index;
1250: # NULL slot for non-PyObject columns. The outer array is NULL until
1251: # `_dataframe_columnar_prebuild_pyobj` runs.
1252: pyobj_built_t** pyobj_built
1253:
1254:
+1255: cdef col_t_arr col_t_arr_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_col_t_arr __pyx_f_7questdb_7_client_col_t_arr_blank(void) {
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_v_arr;
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1256: cdef col_t_arr arr
+1257: arr.size = 0
__pyx_v_arr.size = 0;
+1258: arr.d = NULL
__pyx_v_arr.d = NULL;
+1259: return arr
{
__pyx_r = __pyx_v_arr;
}
goto __pyx_L0;
1260:
1261:
+1262: cdef col_t_arr col_t_arr_new(size_t size) noexcept nogil:
static struct __pyx_t_7questdb_7_client_col_t_arr __pyx_f_7questdb_7_client_col_t_arr_new(size_t __pyx_v_size) {
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_v_arr;
size_t __pyx_v_index;
size_t __pyx_v_freed;
struct __pyx_t_7questdb_7_client_col_t_arr __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1263: cdef col_t_arr arr
1264: cdef size_t index
1265: cdef size_t freed
+1266: arr.size = size
__pyx_v_arr.size = __pyx_v_size;
+1267: arr.d = <col_t*>calloc(size, sizeof(col_t))
__pyx_v_arr.d = ((struct __pyx_t_7questdb_7_client_col_t *)calloc(__pyx_v_size, (sizeof(struct __pyx_t_7questdb_7_client_col_t))));
+1268: if arr.d == NULL:
__pyx_t_1 = (__pyx_v_arr.d == NULL);
if (__pyx_t_1) {
/* … */
}
+1269: arr.size = 0
__pyx_v_arr.size = 0;
+1270: return arr
{
__pyx_r = __pyx_v_arr;
}
goto __pyx_L0;
+1271: for index in range(size):
__pyx_t_2 = __pyx_v_size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+1272: arr.d[index].setup = <col_setup_t*>calloc(1, sizeof(col_setup_t))
(__pyx_v_arr.d[__pyx_v_index]).setup = ((struct __pyx_t_7questdb_7_client_col_setup_t *)calloc(1, (sizeof(struct __pyx_t_7questdb_7_client_col_setup_t))));
+1273: if arr.d[index].setup == NULL:
__pyx_t_1 = ((__pyx_v_arr.d[__pyx_v_index]).setup == NULL);
if (__pyx_t_1) {
/* … */
}
}
+1274: for freed in range(index):
__pyx_t_5 = __pyx_v_index;
__pyx_t_6 = __pyx_t_5;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_v_freed = __pyx_t_7;
+1275: free(arr.d[freed].setup)
free((__pyx_v_arr.d[__pyx_v_freed]).setup);
}
+1276: free(arr.d)
free(__pyx_v_arr.d);
+1277: return col_t_arr_blank()
{
__pyx_r = __pyx_f_7questdb_7_client_col_t_arr_blank();
}
goto __pyx_L0;
+1278: return arr
{
__pyx_r = __pyx_v_arr;
}
goto __pyx_L0;
1279:
1280:
+1281: cdef void col_t_arr_release(col_t_arr* arr) noexcept:
static void __pyx_f_7questdb_7_client_col_t_arr_release(struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_arr) {
size_t __pyx_v_index;
/* … */
/* function exit code */
}
1282: cdef size_t index
+1283: if arr.d:
__pyx_t_1 = (__pyx_v_arr->d != 0);
if (__pyx_t_1) {
/* … */
}
+1284: for index in range(arr.size):
__pyx_t_2 = __pyx_v_arr->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+1285: col_t_release(&arr.d[index])
__pyx_f_7questdb_7_client_col_t_release((&(__pyx_v_arr->d[__pyx_v_index])));
}
+1286: free(arr.d)
free(__pyx_v_arr->d);
+1287: arr.size = 0
__pyx_v_arr->size = 0;
+1288: arr.d = NULL
__pyx_v_arr->d = NULL;
1289:
1290:
+1291: cdef dataframe_plan_t dataframe_plan_blank() noexcept nogil:
static struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_f_7questdb_7_client_dataframe_plan_blank(void) {
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
1292: cdef dataframe_plan_t plan
+1293: plan.row_count = 0
__pyx_v_plan.row_count = 0;
+1294: plan.col_count = 0
__pyx_v_plan.col_count = 0;
+1295: plan.c_table_name.buf = NULL
__pyx_v_plan.c_table_name.buf = NULL;
+1296: plan.c_table_name.len = 0
__pyx_v_plan.c_table_name.len = 0;
+1297: plan.at_value = 0
__pyx_v_plan.at_value = 0;
+1298: plan.cols = col_t_arr_blank()
__pyx_v_plan.cols = __pyx_f_7questdb_7_client_col_t_arr_blank();
+1299: plan.any_cols_need_gil = False
__pyx_v_plan.any_cols_need_gil = 0;
+1300: plan.str_buf_marker.chain = 0
__pyx_v_plan.str_buf_marker.chain = 0;
+1301: plan.str_buf_marker.string = 0
__pyx_v_plan.str_buf_marker.string = 0;
+1302: plan.pyobj_built = NULL
__pyx_v_plan.pyobj_built = NULL;
+1303: return plan
{
__pyx_r = __pyx_v_plan;
}
goto __pyx_L0;
1304:
1305:
+1306: cdef void pyobj_built_free(pyobj_built_t* b) noexcept nogil:
static void __pyx_f_7questdb_7_client_pyobj_built_free(struct __pyx_t_7questdb_7_client_pyobj_built_t *__pyx_v_b) {
/* … */
/* function exit code */
__pyx_L0:;
}
+1307: if b == NULL:
__pyx_t_1 = (__pyx_v_b == NULL);
if (__pyx_t_1) {
/* … */
}
+1308: return
{
}
goto __pyx_L0;
+1309: if b.data != NULL:
__pyx_t_1 = (__pyx_v_b->data != NULL);
if (__pyx_t_1) {
/* … */
}
+1310: free(b.data)
free(__pyx_v_b->data);
+1311: if b.str_offsets != NULL:
__pyx_t_1 = (__pyx_v_b->str_offsets != NULL);
if (__pyx_t_1) {
/* … */
}
+1312: free(b.str_offsets)
free(__pyx_v_b->str_offsets);
+1313: if b.str_bytes != NULL:
__pyx_t_1 = (__pyx_v_b->str_bytes != NULL);
if (__pyx_t_1) {
/* … */
}
+1314: free(b.str_bytes)
free(__pyx_v_b->str_bytes);
+1315: if b.validity != NULL:
__pyx_t_1 = (__pyx_v_b->validity != NULL);
if (__pyx_t_1) {
/* … */
}
+1316: free(b.validity)
free(__pyx_v_b->validity);
+1317: free(b)
free(__pyx_v_b);
1318:
1319:
+1320: cdef void dataframe_plan_release(dataframe_plan_t* plan) noexcept:
static void __pyx_f_7questdb_7_client_dataframe_plan_release(struct __pyx_t_7questdb_7_client_dataframe_plan_t *__pyx_v_plan) {
size_t __pyx_v_i;
/* … */
/* function exit code */
}
1321: cdef size_t i
+1322: if plan.pyobj_built != NULL:
__pyx_t_1 = (__pyx_v_plan->pyobj_built != NULL);
if (__pyx_t_1) {
/* … */
}
+1323: for i in range(plan.col_count):
__pyx_t_2 = __pyx_v_plan->col_count;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
+1324: pyobj_built_free(plan.pyobj_built[i])
__pyx_f_7questdb_7_client_pyobj_built_free((__pyx_v_plan->pyobj_built[__pyx_v_i]));
}
+1325: free(plan.pyobj_built)
free(__pyx_v_plan->pyobj_built);
+1326: plan.pyobj_built = NULL
__pyx_v_plan->pyobj_built = NULL;
+1327: col_t_arr_release(&plan.cols)
__pyx_f_7questdb_7_client_col_t_arr_release((&__pyx_v_plan->cols));
+1328: plan.row_count = 0
__pyx_v_plan->row_count = 0;
+1329: plan.col_count = 0
__pyx_v_plan->col_count = 0;
+1330: plan.c_table_name.buf = NULL
__pyx_v_plan->c_table_name.buf = NULL;
+1331: plan.c_table_name.len = 0
__pyx_v_plan->c_table_name.len = 0;
+1332: plan.at_value = 0
__pyx_v_plan->at_value = 0;
+1333: plan.any_cols_need_gil = False
__pyx_v_plan->any_cols_need_gil = 0;
+1334: plan.str_buf_marker.chain = 0
__pyx_v_plan->str_buf_marker.chain = 0;
+1335: plan.str_buf_marker.string = 0
__pyx_v_plan->str_buf_marker.string = 0;
1336:
1337:
+1338: cdef object _NUMPY = None # module object
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY, Py_None); __Pyx_GIVEREF(Py_None);
+1339: cdef object _NUMPY_BOOL = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_BOOL); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_BOOL, Py_None); __Pyx_GIVEREF(Py_None);
+1340: cdef object _NUMPY_UINT8 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT8, Py_None); __Pyx_GIVEREF(Py_None);
+1341: cdef object _NUMPY_INT8 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT8, Py_None); __Pyx_GIVEREF(Py_None);
+1342: cdef object _NUMPY_UINT16 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT16, Py_None); __Pyx_GIVEREF(Py_None);
+1343: cdef object _NUMPY_INT16 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT16, Py_None); __Pyx_GIVEREF(Py_None);
+1344: cdef object _NUMPY_UINT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT32, Py_None); __Pyx_GIVEREF(Py_None);
+1345: cdef object _NUMPY_INT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT32, Py_None); __Pyx_GIVEREF(Py_None);
+1346: cdef object _NUMPY_UINT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT64, Py_None); __Pyx_GIVEREF(Py_None);
+1347: cdef object _NUMPY_INT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT64, Py_None); __Pyx_GIVEREF(Py_None);
+1348: cdef object _NUMPY_FLOAT32 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT32, Py_None); __Pyx_GIVEREF(Py_None);
+1349: cdef object _NUMPY_FLOAT64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT64, Py_None); __Pyx_GIVEREF(Py_None);
+1350: cdef object _NUMPY_DATETIME64 = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_DATETIME64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_DATETIME64, Py_None); __Pyx_GIVEREF(Py_None);
+1351: cdef object _NUMPY_OBJECT = None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_OBJECT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_OBJECT, Py_None); __Pyx_GIVEREF(Py_None);
+1352: cdef object _PANDAS = None # module object
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS, Py_None); __Pyx_GIVEREF(Py_None);
+1353: cdef object _PANDAS_NA = None # pandas.NA
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NA); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NA, Py_None); __Pyx_GIVEREF(Py_None);
+1354: cdef object _PANDAS_NAT = None # pandas.NaT
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NAT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NAT, Py_None); __Pyx_GIVEREF(Py_None);
+1355: cdef object _PYARROW = None # module object, if available or None
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, Py_None); __Pyx_GIVEREF(Py_None);
1356:
+1357: cdef int64_t _NAT = INT64_MIN # pandas NaT
__pyx_v_7questdb_7_client__NAT = INT64_MIN;
+1358: cdef object _EPOCH_AWARE_UTC = None # datetime(1970, 1, 1, tzinfo=utc)
__Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC, Py_None); __Pyx_GIVEREF(Py_None);
1359:
+1360: cdef bint _dataframe_count_row_path_emissions = False
__pyx_v_7questdb_7_client__dataframe_count_row_path_emissions = 0;
+1361: cdef uint64_t _dataframe_row_path_emissions = 0
__pyx_v_7questdb_7_client__dataframe_row_path_emissions = 0;
1362:
1363:
+1364: cdef str _pandas_too_old_message(object pandas, str what):
static PyObject *__pyx_f_7questdb_7_client__pandas_too_old_message(PyObject *__pyx_v_pandas, PyObject *__pyx_v_what) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._pandas_too_old_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1365: return (
+1366: f'`pandas` {pandas.__version__} is too old: {what} needs '
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_version_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1366, __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(2, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_what); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_pandas; __pyx_t_3[1] = __pyx_t_2; __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_is_too_old; __pyx_t_3[3] = __pyx_t_1; __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u_needs_pandas_ArrowDtype_pandas; __pyx_t_4 = 197; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]); #endif __pyx_t_5 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]); #endif __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_6); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_6 = 0; goto __pyx_L0;
1367: '`pandas.ArrowDtype` (pandas 1.5 or later), and the client is '
1368: 'tested with pandas 2.2 or later. See: '
1369: 'https://py-questdb-client.readthedocs.io/'
1370: 'en/latest/installation.html.')
1371:
1372:
+1373: cdef object _dataframe_may_import_deps():
static PyObject *__pyx_f_7questdb_7_client__dataframe_may_import_deps(void) {
PyObject *__pyx_v_pandas = NULL;
PyObject *__pyx_v_numpy = NULL;
PyObject *__pyx_v_ie = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_may_import_deps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pandas);
__Pyx_XDECREF(__pyx_v_numpy);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1374: global _NUMPY, _PANDAS, _PANDAS_NA, _PANDAS_NAT, _EPOCH_AWARE_UTC
1375: global _NUMPY_BOOL
1376: global _NUMPY_UINT8
1377: global _NUMPY_INT8
1378: global _NUMPY_UINT16
1379: global _NUMPY_INT16
1380: global _NUMPY_UINT32
1381: global _NUMPY_INT32
1382: global _NUMPY_UINT64
1383: global _NUMPY_INT64
1384: global _NUMPY_FLOAT32
1385: global _NUMPY_FLOAT64
1386: global _NUMPY_DATETIME64
1387: global _NUMPY_OBJECT
+1388: if _NUMPY is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__NUMPY != Py_None);
if (__pyx_t_1) {
/* … */
}
+1389: return
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+1390: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__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_L9_try_end:;
}
+1391: import pandas
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pandas_2, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1391, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pandas = __pyx_t_5; __pyx_t_5 = 0;
+1392: import numpy
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1392, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_numpy = __pyx_t_5; __pyx_t_5 = 0;
+1393: except ImportError as ie:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_AddTraceback("questdb._client._dataframe_may_import_deps", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(2, 1393, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_v_ie = __pyx_t_8; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_15, __pyx_t_16); __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+1394: raise ImportError(
__pyx_t_11 = NULL;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_Missing_dependencies_pandas_and};
__pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1394, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_10);
}
1395: 'Missing dependencies: `pandas` and `numpy` must be installed ' +
1396: 'to use the `.dataframe()` method. ' +
1397: 'See: https://py-questdb-client.readthedocs.io/' +
+1398: 'en/latest/installation.html.') from ie
__Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_ie); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(2, 1394, __pyx_L15_error) }
1399: # pandas < 1.5 has no `ArrowDtype`, which the dtype checks read for
1400: # every column. Fail before any global is set, so that a later call
1401: # checks again instead of finding a half-initialised state.
+1402: if not hasattr(pandas, 'ArrowDtype'):
__pyx_t_1 = __Pyx_HasAttr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1402, __pyx_L1_error) __pyx_t_20 = (!__pyx_t_1); if (unlikely(__pyx_t_20)) { /* … */ }
+1403: raise ImportError(
__pyx_t_8 = NULL;
+1404: _pandas_too_old_message(pandas, 'the `.dataframe()` method'))
__pyx_t_5 = __pyx_f_7questdb_7_client__pandas_too_old_message(__pyx_v_pandas, __pyx_mstate_global->__pyx_kp_u_the_dataframe_method); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(2, 1403, __pyx_L1_error)
+1405: _NUMPY_BOOL = type(numpy.dtype('bool'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_bool}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_BOOL); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_BOOL, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1406: _NUMPY_UINT8 = type(numpy.dtype('uint8'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint8}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT8, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1407: _NUMPY_INT8 = type(numpy.dtype('int8'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int8}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT8); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT8, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1408: _NUMPY_UINT16 = type(numpy.dtype('uint16'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint16}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT16, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1409: _NUMPY_INT16 = type(numpy.dtype('int16'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int16}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT16); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT16, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1410: _NUMPY_UINT32 = type(numpy.dtype('uint32'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1411: _NUMPY_INT32 = type(numpy.dtype('int32'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1412: _NUMPY_UINT64 = type(numpy.dtype('uint64'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uint64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_UINT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_UINT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1413: _NUMPY_INT64 = type(numpy.dtype('int64'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_int64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_INT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_INT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1414: _NUMPY_FLOAT32 = type(numpy.dtype('float32'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float32}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT32); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT32, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1415: _NUMPY_FLOAT64 = type(numpy.dtype('float64'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_float64}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_FLOAT64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_FLOAT64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1416: _NUMPY_DATETIME64 = type(numpy.dtype('datetime64[ns]'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_datetime64_ns}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_DATETIME64); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_DATETIME64, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1417: _NUMPY_OBJECT = type(numpy.dtype('object'))
__pyx_t_5 = __pyx_v_numpy; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_object}; __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dtype, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY_OBJECT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY_OBJECT, ((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_9))); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1418: _PANDAS = pandas
__Pyx_INCREF(__pyx_v_pandas); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS, __pyx_v_pandas); __Pyx_GIVEREF(__pyx_v_pandas);
+1419: _PANDAS_NA = pandas.NA
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_NA); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NA); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NA, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0;
+1420: _PANDAS_NAT = pandas.NaT
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas, __pyx_mstate_global->__pyx_n_u_NaT); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PANDAS_NAT); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PANDAS_NAT, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0;
+1421: _EPOCH_AWARE_UTC = datetime.datetime(
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* … */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3], __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XGOTREF(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__EPOCH_AWARE_UTC, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ { PyObject* __pyx_temp[3] = {__pyx_mstate_global->__pyx_int_1970, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1}; __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(2, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
+1422: 1970, 1, 1, tzinfo=datetime.timezone.utc)
__pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_timezone); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_utc); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (PyDict_SetItem(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_tzinfo, __pyx_t_8) < (0)) __PYX_ERR(2, 1422, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1423: _NUMPY = numpy
__Pyx_INCREF(__pyx_v_numpy); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__NUMPY); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__NUMPY, __pyx_v_numpy); __Pyx_GIVEREF(__pyx_v_numpy);
1424:
1425:
+1426: cdef object _dataframe_require_pyarrow():
static PyObject *__pyx_f_7questdb_7_client__dataframe_require_pyarrow(void) {
PyObject *__pyx_v_pyarrow = NULL;
PyObject *__pyx_v_ie = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_require_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pyarrow);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1427: global _PYARROW
+1428: if _PYARROW is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None);
if (__pyx_t_1) {
/* … */
}
+1429: return
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+1430: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__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_L9_try_end:;
}
+1431: import pyarrow
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1431, __pyx_L4_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyarrow = __pyx_t_5; __pyx_t_5 = 0;
+1432: except ImportError as ie:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_AddTraceback("questdb._client._dataframe_require_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(2, 1432, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_v_ie = __pyx_t_8; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_15, __pyx_t_16); __pyx_t_6 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+1433: raise ImportError(
__pyx_t_11 = NULL;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_pyarrow_is_required_for_this_Da};
__pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1433, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_10);
}
1434: '`pyarrow` is required for this DataFrame path '
1435: '(ArrowDtype and Categorical columns, pyarrow Table/RecordBatch '
1436: 'sources, schema_overrides). Install with '
+1437: '`pip install pyarrow`.') from ie
__Pyx_Raise(__pyx_t_10, 0, 0, __pyx_v_ie); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(2, 1433, __pyx_L15_error) }
+1438: _PYARROW = pyarrow
__Pyx_INCREF(__pyx_v_pyarrow); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, __pyx_v_pyarrow); __Pyx_GIVEREF(__pyx_v_pyarrow);
1439:
1440:
+1441: cdef bint _PYARROW_IMPORT_FAILED = False
__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED = 0;
1442:
1443:
+1444: cdef bint _dataframe_try_import_pyarrow():
static int __pyx_f_7questdb_7_client__dataframe_try_import_pyarrow(void) {
PyObject *__pyx_v_pyarrow = NULL;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_try_import_pyarrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_pyarrow);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1445: global _PYARROW, _PYARROW_IMPORT_FAILED
+1446: if _PYARROW is not None:
__pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None);
if (__pyx_t_1) {
/* … */
}
+1447: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
+1448: if _PYARROW_IMPORT_FAILED:
if (__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED) {
/* … */
}
+1449: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
+1450: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L10_try_end;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* … */
__pyx_L7_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_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;
__pyx_L10_try_end:;
}
+1451: import pyarrow
__pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1451, __pyx_L5_error) __pyx_t_5 = __pyx_t_6; __Pyx_GOTREF(__pyx_t_5); __pyx_v_pyarrow = __pyx_t_5; __pyx_t_5 = 0;
+1452: except ImportError:
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); if (__pyx_t_7) { __Pyx_ErrRestore(0,0,0);
+1453: _PYARROW_IMPORT_FAILED = True
__pyx_v_7questdb_7_client__PYARROW_IMPORT_FAILED = 1;
+1454: return False
{
__pyx_r = 0;
}
goto __pyx_L8_except_return;
}
goto __pyx_L7_except_error;
+1455: _PYARROW = pyarrow
__Pyx_INCREF(__pyx_v_pyarrow); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__PYARROW); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__PYARROW, __pyx_v_pyarrow); __Pyx_GIVEREF(__pyx_v_pyarrow);
+1456: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
1457:
1458:
+1459: def _debug_dataframe_pyarrow_loaded():
/* Python wrapper */ static PyObject *__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_7questdb_7_client__debug_dataframe_pyarrow_loaded, "Internal: True iff `.dataframe()` has lazily imported pyarrow in\n this process. Intended for tests that verify a code path stayed\n pyarrow-free."); static PyMethodDef __pyx_mdef_7questdb_7_client_1_debug_dataframe_pyarrow_loaded = {"_debug_dataframe_pyarrow_loaded", (PyCFunction)__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded, METH_NOARGS, __pyx_doc_7questdb_7_client__debug_dataframe_pyarrow_loaded}; static PyObject *__pyx_pw_7questdb_7_client_1_debug_dataframe_pyarrow_loaded(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_debug_dataframe_pyarrow_loaded (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_7questdb_7_client__debug_dataframe_pyarrow_loaded(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7questdb_7_client__debug_dataframe_pyarrow_loaded(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; /* … */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("questdb._client._debug_dataframe_pyarrow_loaded", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* … */ __pyx_t_16 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_1_debug_dataframe_pyarrow_loaded, 0, __pyx_mstate_global->__pyx_n_u_debug_dataframe_pyarrow_loaded, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_16); #endif if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_debug_dataframe_pyarrow_loaded, __pyx_t_16) < (0)) __PYX_ERR(2, 1459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
1460: """Internal: True iff `.dataframe()` has lazily imported pyarrow in
1461: this process. Intended for tests that verify a code path stayed
1462: pyarrow-free."""
+1463: return _PYARROW is not None
__pyx_t_1 = (__pyx_v_7questdb_7_client__PYARROW != Py_None); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_2; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_2 = 0; goto __pyx_L0;
1464:
1465:
+1466: cdef object _dataframe_check_is_dataframe(object df):
static PyObject *__pyx_f_7questdb_7_client__dataframe_check_is_dataframe(PyObject *__pyx_v_df) {
PyObject *__pyx_r = NULL;
/* … */
/* 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_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("questdb._client._dataframe_check_is_dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1467: if not isinstance(df, _PANDAS.DataFrame):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_df, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (!__pyx_t_2); if (unlikely(__pyx_t_3)) { /* … */ }
+1468: raise QuestDBError(
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+1469: QuestDBErrorCode.InvalidApiCall,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1470: f'Bad argument `df`: Expected {_fqn(_PANDAS.DataFrame)}, ' +
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(PyType_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_6))) __PYX_ERR(2, 1470, __pyx_L1_error) __pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ __pyx_t_11 = 53; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[3]); #endif __pyx_t_12 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_10[3]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = 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_13 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 1468, __pyx_L1_error)
+1471: f'not an object of type {_fqn(type(df))}.')
__pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_df)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_df_Expected; __pyx_t_10[1] = __pyx_t_6; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_not_an_object_of_type; __pyx_t_10[3] = __pyx_t_9; __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u__3;
1472:
1473:
+1474: cdef ssize_t _dataframe_resolve_table_name(
static Py_ssize_t __pyx_f_7questdb_7_client__dataframe_resolve_table_name(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_df, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, size_t __pyx_v_col_count, struct line_sender_table_name *__pyx_v_name_out) {
size_t __pyx_v_col_index;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
PyObject *__pyx_v_ie = NULL;
Py_ssize_t __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -2L;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_XDECREF(__pyx_v_ie);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1475: qdb_pystr_buf* b,
1476: object df,
1477: list pandas_cols,
1478: col_t_arr* cols,
1479: object table_name,
1480: object table_name_col,
1481: size_t col_count,
1482: line_sender_table_name* name_out) except -2:
1483: """
1484: Resolve the table name string or column.
1485:
1486: Returns -1 if the table name is a string, otherwise the column index.
1487: """
+1488: cdef size_t col_index = 0
__pyx_v_col_index = 0;
1489: cdef PandasCol pandas_col
1490: cdef col_t* col
+1491: if table_name is not None:
__pyx_t_1 = (__pyx_v_table_name != Py_None);
if (__pyx_t_1) {
/* … */
}
+1492: if table_name_col is not None:
__pyx_t_1 = (__pyx_v_table_name_col != Py_None);
if (unlikely(__pyx_t_1)) {
/* … */
}
+1493: raise ValueError(
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_specify_only_one_of_table_na};
__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(2, 1493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 1493, __pyx_L1_error)
1494: 'Can specify only one of `table_name` or `table_name_col`.')
+1495: if isinstance(table_name, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_table_name);
if (likely(__pyx_t_1)) {
/* … */
}
+1496: try:
{
/*try:*/ {
/* … */
}
__pyx_L6_error:;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/* … */
__pyx_L8_except_error:;
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L1_error;
__pyx_L10_try_return:;
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
goto __pyx_L0;
}
+1497: str_to_table_name_copy(b, <PyObject*>table_name, name_out)
__pyx_t_8 = __pyx_f_7questdb_7_client_str_to_table_name_copy(__pyx_v_b, ((PyObject *)__pyx_v_table_name), __pyx_v_name_out); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1497, __pyx_L6_error)
+1498: return -1 # Magic value for "no column index".
{
__pyx_r = -1L;
}
goto __pyx_L10_try_return;
+1499: except QuestDBError as ie:
__Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_3, &__pyx_t_9); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1499, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_9); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_9 = 0; if (__pyx_t_11) { __Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(2, 1499, __pyx_L8_except_error) __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_v_ie = __pyx_t_3; /*try:*/ { /* … */ /*finally:*/ { __pyx_L17_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; goto __pyx_L8_except_error; } } } goto __pyx_L8_except_error;
+1500: raise ValueError(
__pyx_t_12 = NULL;
+1501: f'Bad argument `table_name`: {ie}')
__pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_v_ie, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1501, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1501, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_14}; __pyx_t_10 = __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_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1500, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(2, 1500, __pyx_L17_error) }
1502: else:
+1503: raise TypeError('Bad argument `table_name`: Must be str.')
/*else*/ {
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_Must_be};
__pyx_t_2 = __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_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 1503, __pyx_L1_error)
}
+1504: elif table_name_col is not None:
__pyx_t_1 = (__pyx_v_table_name_col != Py_None);
if (__pyx_t_1) {
/* … */
}
+1505: if isinstance(table_name_col, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_table_name_col);
if (__pyx_t_1) {
/* … */
goto __pyx_L23;
}
+1506: _dataframe_get_loc(df, table_name_col, 'table_name_col', &col_index)
__pyx_t_2 = __pyx_v_table_name_col;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(2, 1506, __pyx_L1_error)
__pyx_t_8 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_n_u_table_name_col, (&__pyx_v_col_index)); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1506, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1507: elif isinstance(table_name_col, int):
__pyx_t_1 = PyLong_Check(__pyx_v_table_name_col);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L23;
}
+1508: _bind_col_index(
__pyx_t_8 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_table_name_col, __pyx_t_15, __pyx_v_col_count, (&__pyx_v_col_index)); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1508, __pyx_L1_error)
+1509: 'table_name_col', table_name_col, col_count, &col_index)
__pyx_t_15 = __Pyx_PyLong_As_int(__pyx_v_table_name_col); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1509, __pyx_L1_error)
1510: else:
+1511: raise TypeError(
/*else*/ {
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_col_must};
__pyx_t_2 = __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_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1511, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 1511, __pyx_L1_error)
}
__pyx_L23:;
1512: 'Bad argument `table_name_col`: ' +
1513: 'must be a column name (str) or index (int).')
+1514: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1514, __pyx_L1_error)
}
__pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1514, __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_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 1514, __pyx_L1_error)
__pyx_v_pandas_col = ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_2);
__pyx_t_2 = 0;
+1515: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1516: _dataframe_check_column_is_str(
__pyx_t_8 = __pyx_f_7questdb_7_client__dataframe_check_column_is_str(__pyx_mstate_global->__pyx_kp_u_Bad_argument_table_name_col, __pyx_v_pandas_col, __pyx_v_col->setup->source); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1516, __pyx_L1_error)
1517: 'Bad argument `table_name_col`: ',
1518: pandas_col,
1519: col.setup.source)
+1520: col.setup.meta_target = meta_target_t.meta_target_table
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_table;
+1521: name_out.len = 0
__pyx_v_name_out->len = 0;
+1522: name_out.buf = NULL
__pyx_v_name_out->buf = NULL;
+1523: return col_index
{
__pyx_r = __pyx_v_col_index;
}
goto __pyx_L0;
+1524: elif df.index.name:
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1524, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_1)) { /* … */ }
+1525: if not isinstance(df.index.name, str):
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = PyUnicode_Check(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_23 = (!__pyx_t_1); if (unlikely(__pyx_t_23)) { /* … */ }
+1526: raise TypeError(
__pyx_t_3 = NULL;
1527: 'Bad dataframe index name as table name: Expected str, ' +
+1528: f'not an object of type {_fqn(type(df.index.name))}.')
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_t_10)))); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_24[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dataframe_index_name_as_tabl; __pyx_t_24[1] = __pyx_t_10; __pyx_t_24[2] = __pyx_mstate_global->__pyx_kp_u__3; __pyx_t_25 = 77; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_25 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_24[1]); #endif __pyx_t_15 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_15 |= __Pyx_PyUnicode_KIND_04(__pyx_t_24[1]); #endif __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_24, 3, __pyx_t_25, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; __pyx_t_2 = __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_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 1526, __pyx_L1_error)
1529:
1530: # If the index has a name, use that as the table name.
+1531: try:
{
/*try:*/ {
/* … */
}
__pyx_L25_error:;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
/* … */
__pyx_L27_except_error:;
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L29_try_return:;
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
goto __pyx_L0;
}
+1532: str_to_table_name_copy(b, <PyObject*>df.index.name, name_out)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1532, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1532, __pyx_L25_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __pyx_f_7questdb_7_client_str_to_table_name_copy(__pyx_v_b, ((PyObject *)__pyx_t_9), __pyx_v_name_out); if (unlikely(__pyx_t_8 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1532, __pyx_L25_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+1533: return -1 # Magic value for "no column index".
{
__pyx_r = -1L;
}
goto __pyx_L29_try_return;
+1534: except QuestDBError as ie:
__Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_2, &__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1534, __pyx_L27_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_9, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_ErrRestore(__pyx_t_9, __pyx_t_2, __pyx_t_3); __pyx_t_9 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; if (__pyx_t_15) { __Pyx_AddTraceback("questdb._client._dataframe_resolve_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(2, 1534, __pyx_L27_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_v_ie = __pyx_t_2; /*try:*/ { /* … */ /*finally:*/ { __pyx_L36_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17); if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_16 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ie); __pyx_v_ie = 0; } __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20); __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_16; goto __pyx_L27_except_error; } } } goto __pyx_L27_except_error;
+1535: raise ValueError(
__pyx_t_14 = NULL;
+1536: f'Bad dataframe index name as table name: {ie}')
__pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_ie, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1536, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_dataframe_index_name_as_tabl_2, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1536, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; __pyx_t_10 = __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_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1535, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_10); } __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(2, 1535, __pyx_L36_error) }
1537: else:
+1538: raise ValueError(
/*else*/ {
__pyx_t_2 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Must_specify_at_least_one_of_tab};
__pyx_t_9 = __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_9)) __PYX_ERR(2, 1538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(2, 1538, __pyx_L1_error)
}
1539: 'Must specify at least one of `table_name` or `table_name_col`, ' +
1540: 'or set the dataframe index name (df.index.name = \'tbl_name\').')
1541:
1542:
+1543: cdef void_int _bind_col_index(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__bind_col_index(PyObject *__pyx_v_arg_name, int __pyx_v_col_num, size_t __pyx_v_col_count, size_t *__pyx_v_col_index) {
int __pyx_v_bad;
int __pyx_v_orig_col_num;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_6);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._bind_col_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1544: str arg_name, int col_num, size_t col_count,
1545: size_t* col_index) except -1:
1546: """
1547: Validate that `col_index` is in bounds for `col_count`.
1548: This function also converts negative indicies (e.g. -1 for last column) to
1549: positive indicies.
1550: """
+1551: cdef bint bad = False
__pyx_v_bad = 0;
+1552: cdef int orig_col_num = col_num
__pyx_v_orig_col_num = __pyx_v_col_num;
+1553: if col_num < 0:
__pyx_t_1 = (__pyx_v_col_num < 0);
if (__pyx_t_1) {
/* … */
}
+1554: col_num += col_count # Try convert negative offsets to positive ones.
__pyx_v_col_num = (__pyx_v_col_num + __pyx_v_col_count);
+1555: if col_num < 0:
__pyx_t_1 = (__pyx_v_col_num < 0);
if (__pyx_t_1) {
/* … */
}
+1556: bad = True
__pyx_v_bad = 1;
+1557: if (not bad) and (<size_t>col_num >= col_count):
__pyx_t_2 = (!__pyx_v_bad);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_2 = (((size_t)__pyx_v_col_num) >= __pyx_v_col_count);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+1558: bad = True
__pyx_v_bad = 1;
+1559: if bad:
if (unlikely(__pyx_v_bad)) {
/* … */
}
+1560: raise IndexError(
__pyx_t_4 = NULL;
+1561: f'Bad argument `{arg_name}`: {orig_col_num} index out of range')
__pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_arg_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_orig_col_num, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument; __pyx_t_7[1] = __pyx_t_5; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__13; __pyx_t_7[3] = __pyx_t_6; __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_index_out_of_range; __pyx_t_8 = 36; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]); #endif __pyx_t_9 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_9 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __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_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 1560, __pyx_L1_error)
+1562: col_index[0] = <size_t>col_num
(__pyx_v_col_index[0]) = ((size_t)__pyx_v_col_num);
1563:
1564:
+1565: cdef void_int _dataframe_check_column_is_str(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_check_column_is_str(PyObject *__pyx_v_err_msg_prefix, struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, enum __pyx_t_7questdb_7_client_col_source_t __pyx_v_source) {
PyObject *__pyx_v_inferred_descr = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("questdb._client._dataframe_check_column_is_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_inferred_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1566: str err_msg_prefix,
1567: PandasCol pandas_col,
1568: col_source_t source) except -1:
+1569: cdef str inferred_descr = ""
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6);
__pyx_v_inferred_descr = __pyx_mstate_global->__pyx_kp_u__6;
+1570: if not source in _STR_SOURCES:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_7questdb_7_client__STR_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable"); __PYX_ERR(2, 1570, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__STR_SOURCES, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1570, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1571: if isinstance(pandas_col.dtype, _NUMPY_OBJECT):
__pyx_t_1 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = __pyx_v_7questdb_7_client__NUMPY_OBJECT;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1571, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
/* … */
}
1572: inferred_descr = (
+1573: f' (inferred type: '
__pyx_t_5 = 18;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]);
#endif
__pyx_t_6 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]);
#endif
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_inferred_descr, ((PyObject*)__pyx_t_1));
__pyx_t_1 = 0;
+1574: f'{_PYOBJ_SOURCE_DESCR.get(source, "unknown")})')
if (unlikely(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "get");
__PYX_ERR(2, 1574, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_source); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_unknown); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1574, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_inferred_type;
__pyx_t_4[1] = __pyx_t_3;
__pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__11;
+1575: raise QuestDBError(
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+1576: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1577: err_msg_prefix +
__pyx_t_8 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_err_msg_prefix, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+1578: f'Bad dtype `{pandas_col.dtype}`{inferred_descr} for the ' +
__pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dtype; __pyx_t_10[1] = __pyx_t_8; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__14; __pyx_t_10[3] = __pyx_v_inferred_descr; __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_for_the; __pyx_t_5 = 21; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[3]); #endif __pyx_t_6 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_10[3]); #endif __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ __pyx_t_11 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_13 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 1575, __pyx_L1_error)
+1579: f'{pandas_col.name!r} column: Must be a strings column.')
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_column_Must_be_a_strings_column); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1580:
1581:
+1582: @cython.internal
struct __pyx_obj_7questdb_7_client_PandasCol {
PyObject_HEAD
PyObject *name;
PyObject *dtype;
PyObject *series;
PyObject *claim_kind;
};
1583: cdef class PandasCol:
1584: """Python object representing a column to parse .dataframe() arguments."""
1585: cdef str name
1586: cdef object dtype
1587: cdef object series
1588: # The `kind` of the column's `df.attrs['questdb']` claim, read only
1589: # for the column-QWP planner, or None.
1590: cdef str claim_kind
1591:
+1592: def __init__(
/* Python wrapper */
static int __pyx_pw_7questdb_7_client_9PandasCol_1__init__(PyObject *__pyx_v_self,
#if CYTHON_VECTORCALL_TPNEW
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_pw_7questdb_7_client_9PandasCol_1__init__(PyObject *__pyx_v_self,
#if CYTHON_VECTORCALL_TPNEW
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;
PyObject *__pyx_v_dtype = 0;
PyObject *__pyx_v_series = 0;
#if !CYTHON_VECTORCALL_TPNEW
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if !CYTHON_VECTORCALL_TPNEW
#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
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_dtype,&__pyx_mstate_global->__pyx_n_u_series,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 1592, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1592, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1592, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1592, __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(2, 1592, __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(2, 1592, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 1592, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 1592, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 1592, __pyx_L3_error)
}
__pyx_v_name = ((PyObject*)values[0]);
__pyx_v_dtype = values[1];
__pyx_v_series = values[2];
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1592, __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("questdb._client.PandasCol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(2, 1594, __pyx_L1_error)
__pyx_r = __pyx_pf_7questdb_7_client_9PandasCol___init__(((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_v_self), __pyx_v_name, __pyx_v_dtype, __pyx_v_series);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* 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_7questdb_7_client_9PandasCol___init__(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_dtype, PyObject *__pyx_v_series) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1593: self,
1594: str name,
1595: object dtype,
1596: object series):
+1597: self.name = name
__Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name;
+1598: self.dtype = dtype
__Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_dtype;
+1599: self.series = series
__Pyx_INCREF(__pyx_v_series); __Pyx_GIVEREF(__pyx_v_series); __Pyx_GOTREF(__pyx_v_self->series); __Pyx_DECREF(__pyx_v_self->series); __pyx_v_self->series = __pyx_v_series;
+1600: self.claim_kind = None
__Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->claim_kind); __Pyx_DECREF(__pyx_v_self->claim_kind); __pyx_v_self->claim_kind = ((PyObject*)Py_None);
1601:
+1602: cdef void_int _dataframe_resolve_symbols(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_symbols(PyObject *__pyx_v_df, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, Py_ssize_t __pyx_v_table_name_col, Py_ssize_t __pyx_v_at_col, PyObject *__pyx_v_symbols) {
size_t __pyx_v_col_index;
PyObject *__pyx_v_symbol = 0;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_symbol);
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1603: object df,
1604: list pandas_cols,
1605: col_t_arr* cols,
1606: ssize_t table_name_col,
1607: ssize_t at_col,
1608: object symbols) except -1:
+1609: cdef size_t col_index = 0
__pyx_v_col_index = 0;
1610: cdef object symbol
1611: cdef PandasCol pandas_col
1612: cdef col_t* col
+1613: if symbols == 'auto':
__pyx_t_1 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_symbols, __pyx_mstate_global->__pyx_n_u_auto, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1613, __pyx_L1_error) if (__pyx_t_1) { /* … */ goto __pyx_L3; }
+1614: for col_index in range(cols.size):
__pyx_t_2 = __pyx_v_cols->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_col_index = __pyx_t_4;
+1615: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1615, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 1615, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+1616: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1617: if col.setup.meta_target == meta_target_t.meta_target_field:
__pyx_t_1 = (__pyx_v_col->setup->meta_target == __pyx_e_7questdb_7_client_meta_target_field);
if (__pyx_t_1) {
/* … */
}
}
+1618: if isinstance(pandas_col.dtype, _PANDAS.CategoricalDtype):
__pyx_t_5 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_CategoricalDtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyObject_IsInstance(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1618, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
/* … */
}
+1619: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
+1620: elif symbols is False:
__pyx_t_1 = (__pyx_v_symbols == Py_False);
if (__pyx_t_1) {
goto __pyx_L3;
}
1621: pass
+1622: elif symbols is True:
__pyx_t_1 = (__pyx_v_symbols == Py_True);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+1623: for col_index in range(cols.size):
__pyx_t_2 = __pyx_v_cols->size;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_col_index = __pyx_t_4;
+1624: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1625: if col.setup.source in _STR_SOURCES:
__pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_7questdb_7_client__STR_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable"); __PYX_ERR(2, 1625, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_7questdb_7_client__STR_SOURCES, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 1625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { /* … */ } }
+1626: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1626, __pyx_L1_error)
}
__pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1626, __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_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 1626, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_6));
__pyx_t_6 = 0;
+1627: if col.setup.meta_target == meta_target_t.meta_target_field:
__pyx_t_1 = (__pyx_v_col->setup->meta_target == __pyx_e_7questdb_7_client_meta_target_field);
if (__pyx_t_1) {
/* … */
}
+1628: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
1629: else:
+1630: if not isinstance(symbols, (tuple, list)):
/*else*/ {
__pyx_t_7 = PyTuple_Check(__pyx_v_symbols);
if (!__pyx_t_7) {
} else {
__pyx_t_1 = __pyx_t_7;
goto __pyx_L13_bool_binop_done;
}
__pyx_t_7 = PyList_Check(__pyx_v_symbols);
__pyx_t_1 = __pyx_t_7;
__pyx_L13_bool_binop_done:;
__pyx_t_7 = (!__pyx_t_1);
if (unlikely(__pyx_t_7)) {
/* … */
}
+1631: raise TypeError(
__pyx_t_5 = NULL;
__pyx_t_2 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Must_be_a_b};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1631, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(2, 1631, __pyx_L1_error)
1632: f'Bad argument `symbols`: Must be a bool or a tuple or list '+
1633: 'of column names (str) or indices (int).')
+1634: for symbol in symbols:
if (likely(PyList_CheckExact(__pyx_v_symbols)) || PyTuple_CheckExact(__pyx_v_symbols)) { __pyx_t_6 = __pyx_v_symbols; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_symbols); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1634, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1634, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 1634, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8)); #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); #endif ++__pyx_t_8; } if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1634, __pyx_L1_error) } else { __pyx_t_5 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 1634, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_symbol, __pyx_t_5); __pyx_t_5 = 0; /* … */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:;
+1635: if isinstance(symbol, str):
__pyx_t_7 = PyUnicode_Check(__pyx_v_symbol);
if (__pyx_t_7) {
/* … */
goto __pyx_L17;
}
+1636: _dataframe_get_loc(df, symbol, 'symbols', &col_index)
__pyx_t_5 = __pyx_v_symbol;
__Pyx_INCREF(__pyx_t_5);
if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(2, 1636, __pyx_L1_error)
__pyx_t_10 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_5), __pyx_mstate_global->__pyx_n_u_symbols, (&__pyx_v_col_index)); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1636, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+1637: elif isinstance(symbol, int):
__pyx_t_7 = PyLong_Check(__pyx_v_symbol);
if (likely(__pyx_t_7)) {
/* … */
goto __pyx_L17;
}
+1638: _bind_col_index('symbol', symbol, cols.size, &col_index)
__pyx_t_11 = __Pyx_PyLong_As_int(__pyx_v_symbol); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1638, __pyx_L1_error) __pyx_t_10 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_symbol, __pyx_t_11, __pyx_v_cols->size, (&__pyx_v_col_index)); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1638, __pyx_L1_error)
1639: else:
+1640: raise TypeError(
/*else*/ {
__pyx_t_12 = NULL;
__pyx_t_2 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Elements_mu};
__pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1640, __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(2, 1640, __pyx_L1_error)
}
__pyx_L17:;
1641: f'Bad argument `symbols`: Elements must ' +
1642: 'be a column name (str) or index (int).')
+1643: if (table_name_col >= 0) and (col_index == <size_t>table_name_col):
__pyx_t_1 = (__pyx_v_table_name_col >= 0);
if (__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
goto __pyx_L19_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_col_index == ((size_t)__pyx_v_table_name_col));
__pyx_t_7 = __pyx_t_1;
__pyx_L19_bool_binop_done:;
if (unlikely(__pyx_t_7)) {
/* … */
}
+1644: raise ValueError(
__pyx_t_12 = NULL;
+1645: f'Bad argument `symbols`: Cannot use the same column ' +
__pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Cannot_use, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_2 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1644, __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(2, 1644, __pyx_L1_error)
+1646: f'{symbol!r} as both the table_name and as a symbol.')
__pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_symbol), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_14 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_as_both_the_table_name_and_as_a); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+1647: if (at_col >= 0) and (col_index == <size_t>at_col):
__pyx_t_1 = (__pyx_v_at_col >= 0);
if (__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_col_index == ((size_t)__pyx_v_at_col));
__pyx_t_7 = __pyx_t_1;
__pyx_L22_bool_binop_done:;
if (unlikely(__pyx_t_7)) {
/* … */
}
+1648: raise ValueError(
__pyx_t_13 = NULL;
1649: f'Bad argument `symbols`: Cannot use the `at` column ' +
+1650: f'({df.columns[at_col]!r}) as a symbol column.')
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_12, __pyx_v_at_col, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_14), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols_Cannot_use_2; __pyx_t_15[1] = __pyx_t_12; __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_as_a_symbol_column; __pyx_t_16 = 73; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_16 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15[1]); #endif __pyx_t_11 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 |= __Pyx_PyUnicode_KIND_04(__pyx_t_15[1]); #endif __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __pyx_t_16, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_2 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_2, (2-__pyx_t_2) | (__pyx_t_2*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1648, __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(2, 1648, __pyx_L1_error)
+1651: pandas_col = pandas_cols[col_index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1651, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 1651, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+1652: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1653: _dataframe_check_column_is_str(
__pyx_t_10 = __pyx_f_7questdb_7_client__dataframe_check_column_is_str(__pyx_mstate_global->__pyx_kp_u_Bad_argument_symbols, __pyx_v_pandas_col, __pyx_v_col->setup->source); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1653, __pyx_L1_error)
1654: 'Bad argument `symbols`: ',
1655: pandas_col,
1656: col.setup.source)
+1657: col.setup.meta_target = meta_target_t.meta_target_symbol
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_symbol;
1658:
1659:
+1660: cdef void_int _dataframe_get_loc(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_get_loc(PyObject *__pyx_v_df, PyObject *__pyx_v_col_name, PyObject *__pyx_v_arg_name, size_t *__pyx_v_col_index_out) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_AddTraceback("questdb._client._dataframe_get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1661: object df, str col_name, str arg_name,
1662: size_t* col_index_out) except -1:
1663: """
1664: Return the column index for `col_name`.
1665: """
+1666: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* … */
__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_L8_try_end:;
}
+1667: col_index_out[0] = df.columns.get_loc(col_name)
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1667, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_col_name}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_loc, __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_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1667, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_7 = __Pyx_PyLong_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1667, __pyx_L3_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_col_index_out[0]) = __pyx_t_7;
+1668: except KeyError:
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError)))); if (__pyx_t_8) { __Pyx_AddTraceback("questdb._client._dataframe_get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(2, 1668, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5);
+1669: raise KeyError(
__pyx_t_10 = NULL;
+1670: f'Bad argument `{arg_name}`: ' +
__pyx_t_11 = __Pyx_PyUnicode_Unicode(__pyx_v_arg_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1670, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_11); /* … */ __pyx_t_14 = 52; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[3]); #endif __pyx_t_8 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 |= __Pyx_PyUnicode_KIND_04(__pyx_t_13[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_13[3]); #endif __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_13, 5, __pyx_t_14, __pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1670, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_15}; __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1669, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(2, 1669, __pyx_L5_except_error) } goto __pyx_L5_except_error;
+1671: f'Column {col_name!r} not found in the dataframe.')
__pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1671, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument; __pyx_t_13[1] = __pyx_t_11; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_Column; __pyx_t_13[3] = __pyx_t_12; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u_not_found_in_the_dataframe;
1672:
1673:
1674: # The values -2 and -1 are safe to use as a sentinel because the TimestampNanos
1675: # type already validates that the value is >= 0.
+1676: cdef int64_t _AT_IS_SERVER_NOW = -2
__pyx_v_7questdb_7_client__AT_IS_SERVER_NOW = -2L;
+1677: cdef int64_t _AT_IS_SET_BY_COLUMN = -1
__pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN = -1L;
1678:
1679:
+1680: cdef str _SUPPORTED_DATETIMES = 'datetime64[ns], datetime64[us], datetime64[ns, tz], datetime64[us, tz], timestamp[ns][pyarrow], or timestamp[us][pyarrow]'
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES, __pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_datetime64_ns_datetime64_us_date);
1681:
1682:
+1683: cdef int _dataframe_classify_numpy_timestamp_dtype(object dtype):
static int __pyx_f_7questdb_7_client__dataframe_classify_numpy_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_dtype_str = 0;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_classify_numpy_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype_str);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1684: cdef str dtype_str = str(dtype)
__pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dtype_str = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
1685: # Pandas 3 may infer bare numpy.datetime64 values as coarser units such as
1686: # datetime64[s]. We already serialize numpy timestamps via the existing
1687: # microsecond or nanosecond buffer paths, so normalize these coarser units
1688: # to microseconds before exporting the raw numpy buffer.
+1689: if dtype_str == 'datetime64[ns]':
__pyx_t_2 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_dtype_str, __pyx_mstate_global->__pyx_kp_u_datetime64_ns, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1689, __pyx_L1_error) if (__pyx_t_2) { /* … */ }
+1690: return col_source_t.col_source_dt64ns_numpy
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_numpy;
}
goto __pyx_L0;
+1691: elif dtype_str in (
__Pyx_INCREF(__pyx_v_dtype_str); __pyx_t_3 = __pyx_v_dtype_str; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_us, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_ms, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_s, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_m, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_h, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_D, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_datetime64_W, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 1691, __pyx_L1_error) __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_2; if (__pyx_t_4) { /* … */ }
1692: 'datetime64[us]',
1693: 'datetime64[ms]',
1694: 'datetime64[s]',
1695: 'datetime64[m]',
1696: 'datetime64[h]',
1697: 'datetime64[D]',
1698: 'datetime64[W]'):
+1699: return col_source_t.col_source_dt64us_numpy
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_numpy;
}
goto __pyx_L0;
1700: else:
+1701: return 0
/*else*/ {
{
__pyx_r = 0;
}
goto __pyx_L0;
}
1702:
1703:
+1704: cdef int _dataframe_classify_timestamp_dtype(object dtype) except -1:
static int __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_arrow_type = 0;
int __pyx_r;
/* … */
/* 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_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("questdb._client._dataframe_classify_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_arrow_type);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1705: """
1706: Classify the dtype and determine if it's supported for use as a timestamp.
1707:
1708: Returns:
1709: > 0 - a value castable to a `col_source_t`.
1710: 0 - dtype is not a supported timestamp datatype.
1711: """
1712: cdef object arrow_type
+1713: if isinstance(dtype, _NUMPY_DATETIME64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_DATETIME64; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1714: return _dataframe_classify_numpy_timestamp_dtype(dtype)
__pyx_t_3 = __pyx_f_7questdb_7_client__dataframe_classify_numpy_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1714, __pyx_L1_error) { __pyx_r = __pyx_t_3; } goto __pyx_L0;
+1715: elif isinstance(dtype, _PANDAS.DatetimeTZDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_DatetimeTZDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1716: if dtype.unit == 'ns':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1717: return col_source_t.col_source_dt64ns_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow;
}
goto __pyx_L0;
+1718: elif dtype.unit == 'us':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_us, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { /* … */ }
+1719: return col_source_t.col_source_dt64us_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow;
}
goto __pyx_L0;
1720: else:
+1721: raise QuestDBError(
/*else*/ {
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1721, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+1722: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1723: f'Unsupported pandas dtype {dtype} unit {dtype.unit}. ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Unsupported_pandas_dtype; __pyx_t_10[1] = __pyx_t_6; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_unit_2; __pyx_t_10[3] = __pyx_t_9; __pyx_t_10[4] = __pyx_mstate_global->__pyx_kp_u_Raise_an_issue_if_you_think_it; __pyx_t_11 = 137; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[3]); #endif __pyx_t_3 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_10[3]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 5, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_12 = 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_12 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 1721, __pyx_L1_error) }
1724: 'Raise an issue if you think it should be supported: ' +
1725: 'https://github.com/questdb/py-questdb-client/issues.')
+1726: elif isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1727: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1728: arrow_type = dtype.pyarrow_dtype
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arrow_type = __pyx_t_1; __pyx_t_1 = 0;
+1729: if arrow_type.id == _PYARROW.lib.Type_TIMESTAMP:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Type_TIMESTAMP); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_1, __pyx_t_8, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { /* … */ }
+1730: if arrow_type.unit == "ns":
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ns, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { /* … */ }
+1731: return col_source_t.col_source_dt64ns_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ns_tz_arrow;
}
goto __pyx_L0;
+1732: elif arrow_type.unit == "us":
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_us, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { /* … */ }
+1733: return col_source_t.col_source_dt64us_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64us_tz_arrow;
}
goto __pyx_L0;
1734: # s / ms fall through: field -> generic Arrow passthrough;
1735: # designated-at -> _dataframe_classify_at_timestamp_dtype.
+1736: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
1737:
1738:
+1739: cdef int _dataframe_classify_at_timestamp_dtype(object dtype) except -1:
static int __pyx_f_7questdb_7_client__dataframe_classify_at_timestamp_dtype(PyObject *__pyx_v_dtype) {
PyObject *__pyx_v_arrow_type = 0;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_classify_at_timestamp_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_arrow_type);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1740: # ms / s designated-`at` Arrow timestamps, widened to micros in Rust by
1741: # the millis/seconds designated-timestamp FFI. Kept out of the shared
1742: # field classifier so timestamp fields still route to the generic Arrow
1743: # passthrough and row-ILP stays untouched.
1744: cdef object arrow_type
+1745: if isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 1745, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+1746: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1747: arrow_type = dtype.pyarrow_dtype
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arrow_type = __pyx_t_1; __pyx_t_1 = 0;
+1748: if arrow_type.id == _PYARROW.lib.Type_TIMESTAMP:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_TIMESTAMP); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* … */ }
+1749: if arrow_type.unit == "ms":
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ms, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1749, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* … */ }
+1750: return col_source_t.col_source_dt64ms_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64ms_tz_arrow;
}
goto __pyx_L0;
+1751: elif arrow_type.unit == "s":
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrow_type, __pyx_mstate_global->__pyx_n_u_unit); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = (__Pyx_PyObject_Equals_obj_ch115(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 1751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* … */ }
+1752: return col_source_t.col_source_dt64s_tz_arrow
{
__pyx_r = __pyx_e_7questdb_7_client_col_source_dt64s_tz_arrow;
}
goto __pyx_L0;
+1753: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
1754:
1755:
+1756: cdef ssize_t _dataframe_resolve_at(
static Py_ssize_t __pyx_f_7questdb_7_client__dataframe_resolve_at(PyObject *__pyx_v_df, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_at, size_t __pyx_v_col_count, int64_t *__pyx_v_at_value_out, int __pyx_v_columnar) {
size_t __pyx_v_col_index;
PyObject *__pyx_v_dtype = 0;
struct __pyx_obj_7questdb_7_client_TimestampNanos *__pyx_v_at_nanos = 0;
int64_t __pyx_v_at_value;
int __pyx_v_at_source;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
Py_ssize_t __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -2L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XDECREF((PyObject *)__pyx_v_at_nanos);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1757: object df,
1758: col_t_arr* cols,
1759: object at,
1760: size_t col_count,
1761: int64_t* at_value_out,
1762: bint columnar) except -2:
1763: cdef size_t col_index
1764: cdef object dtype
1765: cdef PandasCol pandas_col
1766: cdef TimestampNanos at_nanos
1767: cdef int64_t at_value
1768: cdef int at_source
+1769: if at is None:
__pyx_t_1 = (__pyx_v_at == Py_None);
if (__pyx_t_1) {
/* … */
}
+1770: at_value_out[0] = _AT_IS_SERVER_NOW
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW;
+1771: return -1
{
__pyx_r = -1L;
}
goto __pyx_L0;
+1772: elif isinstance(at, TimestampNanos):
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_TimestampNanos);
if (__pyx_t_1) {
/* … */
}
+1773: at_nanos = at
__pyx_t_2 = __pyx_v_at;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_TimestampNanos))))) __PYX_ERR(2, 1773, __pyx_L1_error)
__pyx_v_at_nanos = ((struct __pyx_obj_7questdb_7_client_TimestampNanos *)__pyx_t_2);
__pyx_t_2 = 0;
+1774: at_value_out[0] = at_nanos._value
__pyx_t_3 = __pyx_v_at_nanos->_value;
(__pyx_v_at_value_out[0]) = __pyx_t_3;
+1775: return -1
{
__pyx_r = -1L;
}
goto __pyx_L0;
+1776: elif isinstance(at, cp_datetime):
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime);
if (__pyx_t_1) {
/* … */
}
+1777: at_value = datetime_to_nanos(at)
if (!(likely(((__pyx_v_at) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_at, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(2, 1777, __pyx_L1_error) __pyx_t_3 = __pyx_f_7questdb_7_client_datetime_to_nanos(((PyDateTime_DateTime *)__pyx_v_at)); if (unlikely(__pyx_t_3 == ((int64_t)-1L) && PyErr_Occurred())) __PYX_ERR(2, 1777, __pyx_L1_error) __pyx_v_at_value = __pyx_t_3;
+1778: if at_value < 0:
__pyx_t_1 = (__pyx_v_at_value < 0);
if (unlikely(__pyx_t_1)) {
/* … */
}
+1779: raise ValueError(
__pyx_t_4 = NULL;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Cannot_use_a_dat};
__pyx_t_2 = __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_2)) __PYX_ERR(2, 1779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 1779, __pyx_L1_error)
1780: 'Bad argument `at`: Cannot use a datetime before the ' +
1781: 'Unix epoch (1970-01-01 00:00:00).')
+1782: at_value_out[0] = at_value
(__pyx_v_at_value_out[0]) = __pyx_v_at_value;
+1783: return -1
{
__pyx_r = -1L;
}
goto __pyx_L0;
+1784: elif isinstance(at, str):
__pyx_t_1 = PyUnicode_Check(__pyx_v_at);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+1785: _dataframe_get_loc(df, at, 'at', &col_index)
__pyx_t_2 = __pyx_v_at;
__Pyx_INCREF(__pyx_t_2);
if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(2, 1785, __pyx_L1_error)
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_get_loc(__pyx_v_df, ((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_n_u_at, (&__pyx_v_col_index)); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1785, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1786: elif isinstance(at, int):
__pyx_t_1 = PyLong_Check(__pyx_v_at);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+1787: _bind_col_index('at', at, col_count, &col_index)
__pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_at); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 1787, __pyx_L1_error) __pyx_t_6 = __pyx_f_7questdb_7_client__bind_col_index(__pyx_mstate_global->__pyx_n_u_at, __pyx_t_7, __pyx_v_col_count, (&__pyx_v_col_index)); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1787, __pyx_L1_error)
1788: else:
+1789: raise TypeError(
/*else*/ {
__pyx_t_4 = NULL;
+1790: f'Bad argument `at`: Unsupported type {_fqn(type(at))}. ' +
__pyx_t_8 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_at)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Unsupported_type; __pyx_t_10[1] = __pyx_t_9; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_Must_be_one_of_None_TimestampNa; __pyx_t_11 = 122; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]); #endif __pyx_t_7 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; __pyx_t_2 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 1789, __pyx_L1_error) } __pyx_L3:;
1791: 'Must be one of: None, TimestampNanos, datetime, ' +
1792: 'int (column index), str (colum name)')
+1793: dtype = df.dtypes.iloc[col_index]
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_col_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0;
+1794: if _dataframe_classify_timestamp_dtype(dtype) != 0:
__pyx_t_7 = __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1794, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_7 != 0);
if (__pyx_t_1) {
/* … */
}
+1795: at_value_out[0] = _AT_IS_SET_BY_COLUMN
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN;
+1796: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1797: col.setup.meta_target = meta_target_t.meta_target_at
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_at;
+1798: return col_index
{
__pyx_r = __pyx_v_col_index;
}
goto __pyx_L0;
+1799: if columnar:
if (__pyx_v_columnar) {
/* … */
}
1800: # ms / s Arrow timestamps resolved to the generic passthrough source
1801: # in `_dataframe_resolve_source_and_buffers`; the buffers are already
1802: # mapped, so override the source to the designated-ts unit and let the
1803: # Rust millis/seconds FFI widen to micros.
+1804: at_source = _dataframe_classify_at_timestamp_dtype(dtype)
__pyx_t_7 = __pyx_f_7questdb_7_client__dataframe_classify_at_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1804, __pyx_L1_error)
__pyx_v_at_source = __pyx_t_7;
+1805: if at_source != 0:
__pyx_t_1 = (__pyx_v_at_source != 0);
if (__pyx_t_1) {
/* … */
}
+1806: at_value_out[0] = _AT_IS_SET_BY_COLUMN
(__pyx_v_at_value_out[0]) = __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN;
+1807: col = &cols.d[col_index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_col_index]));
+1808: col.setup.source = <col_source_t>at_source
__pyx_v_col->setup->source = ((enum __pyx_t_7questdb_7_client_col_source_t)__pyx_v_at_source);
+1809: col.setup.meta_target = meta_target_t.meta_target_at
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_at;
+1810: return col_index
{
__pyx_r = __pyx_v_col_index;
}
goto __pyx_L0;
+1811: raise TypeError(
__pyx_t_8 = NULL;
+1812: f'Bad argument `at`: Bad dtype `{dtype}` ' +
__pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_11 = 67; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[5]); #endif __pyx_t_7 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_13[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_13[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_13[5]); #endif __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 7, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_14}; __pyx_t_2 = __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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 1811, __pyx_L1_error)
+1813: f'for the {at!r} column: Must be a {_SUPPORTED_DATETIMES} column.')
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_at), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyUnicode_Unicode(__pyx_v_7questdb_7_client__SUPPORTED_DATETIMES); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 1813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Bad_argument_at_Bad_dtype; __pyx_t_13[1] = __pyx_t_4; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_for_the_2; __pyx_t_13[3] = __pyx_t_9; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u_column_Must_be_a; __pyx_t_13[5] = __pyx_t_12; __pyx_t_13[6] = __pyx_mstate_global->__pyx_kp_u_column;
1814:
1815:
+1816: cdef void_int _dataframe_alloc_chunks(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_alloc_chunks(size_t __pyx_v_n_chunks, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct ArrowArray *__pyx_v_chunks;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._dataframe_alloc_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
1817: size_t n_chunks, col_t* col) except -1:
+1818: cdef ArrowArray* chunks = <ArrowArray*>calloc(
__pyx_v_chunks = ((struct ArrowArray *)calloc((__pyx_v_n_chunks + 1), (sizeof(struct ArrowArray))));
1819: n_chunks + 1, # See `_dataframe_col_advance` on why +1.
1820: sizeof(ArrowArray))
+1821: if chunks == NULL:
__pyx_t_1 = (__pyx_v_chunks == NULL);
if (unlikely(__pyx_t_1)) {
/* … */
}
+1822: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(2, 1822, __pyx_L1_error)
+1823: col.setup.chunks.chunks = chunks
__pyx_v_col->setup->chunks.chunks = __pyx_v_chunks;
+1824: col.setup.chunks.n_chunks = n_chunks
__pyx_v_col->setup->chunks.n_chunks = __pyx_v_n_chunks;
1825:
1826:
+1827: cdef void _dataframe_free_mapped_arrow(ArrowArray* arr) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_free_mapped_arrow(struct ArrowArray *__pyx_v_arr) {
/* … */
/* function exit code */
}
+1828: free(arr.buffers)
free(__pyx_v_arr->buffers);
+1829: arr.buffers = NULL
__pyx_v_arr->buffers = NULL;
+1830: arr.release = NULL
__pyx_v_arr->release = NULL;
1831:
1832:
+1833: cdef void_int _dataframe_series_as_pybuf(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, struct __pyx_opt_args_7questdb_7_client__dataframe_series_as_pybuf *__pyx_optional_args) {
/* … */
/* 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_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_XDECREF(__pyx_t_28);
__Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_nparr);
__Pyx_XDECREF(__pyx_v_ve);
__Pyx_XDECREF(__pyx_v_be);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
struct __pyx_opt_args_7questdb_7_client__dataframe_series_as_pybuf {
int __pyx_n;
PyObject *fallback_dtype;
};
+1834: PandasCol pandas_col, col_t* col, str fallback_dtype=None) except -1:
PyObject *__pyx_v_fallback_dtype = ((PyObject*)Py_None);
PyObject *__pyx_v_nparr = 0;
struct ArrowArray *__pyx_v_mapped;
CYTHON_UNUSED int __pyx_v_get_buf_ret;
PyObject *__pyx_v_ve = NULL;
PyObject *__pyx_v_be = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_fallback_dtype = __pyx_optional_args->fallback_dtype;
}
}
+1835: cdef object nparr = pandas_col.series.to_numpy(dtype=fallback_dtype)
__pyx_t_2 = __pyx_v_pandas_col->series; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_fallback_dtype}; #if CYTHON_VECTORCALL __pyx_t_4 = __pyx_mstate_global->__pyx_tuple[4]; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1835, __pyx_L1_error) __Pyx_INCREF(__pyx_t_4); #else { PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_dtype}; __pyx_t_4 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } #endif __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_to_numpy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__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; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_nparr = __pyx_t_1; __pyx_t_1 = 0; /* … */ { PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_dtype}; __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(2, 1835, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
1836: cdef ArrowArray* mapped
1837: cdef int get_buf_ret
+1838: if not PyObject_CheckBuffer(nparr):
__pyx_t_5 = (!PyObject_CheckBuffer(__pyx_v_nparr));
if (unlikely(__pyx_t_5)) {
/* … */
}
+1839: raise TypeError(
__pyx_t_4 = NULL;
+1840: f'Bad column {pandas_col.name!r}: Expected a buffer, got ' +
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* … */ __pyx_t_10 = 39; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[5]); #endif __pyx_t_11 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 |= __Pyx_PyUnicode_KIND_04(__pyx_t_9[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[5]); #endif __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__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_1)) __PYX_ERR(2, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 1839, __pyx_L1_error)
+1841: f'{pandas_col.series!r} ({_fqn(type(pandas_col.series))})')
__pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->series), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_pandas_col->series)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_9[1] = __pyx_t_2; __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_buffer_got; __pyx_t_9[3] = __pyx_t_6; __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__15; __pyx_t_9[5] = __pyx_t_8; __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__11;
+1842: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
goto __pyx_L9_try_end;
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
/* … */
__pyx_L6_except_error:;
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
goto __pyx_L1_error;
__pyx_L9_try_end:;
}
1843: # Note! We don't need to support numpy strides since Pandas doesn't.
1844: # Also note that this guarantees a 1D buffer.
+1845: get_buf_ret = PyObject_GetBuffer(nparr, &col.setup.pybuf, PyBUF_SIMPLE)
__pyx_t_11 = PyObject_GetBuffer(__pyx_v_nparr, (&__pyx_v_col->setup->pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 1845, __pyx_L4_error) __pyx_v_get_buf_ret = __pyx_t_11;
+1846: except ValueError as ve:
__pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError)))); if (__pyx_t_11) { __Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(2, 1846, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_v_ve = __pyx_t_7; /*try:*/ { /* … */ /*finally:*/ { __pyx_L15_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27); if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_27); __pyx_t_11 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_ve); __pyx_v_ve = 0; } __Pyx_XGIVEREF(__pyx_t_25); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24); __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21; goto __pyx_L6_except_error; } } }
+1847: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1847, __pyx_L15_error)
__Pyx_GOTREF(__pyx_t_2);
+1848: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1848, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1848, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+1849: f'Bad column {pandas_col.name!r}: {ve}') from ve
__pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1849, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_17 = __Pyx_PyObject_FormatSimple(__pyx_v_ve, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1849, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_18[1] = __pyx_t_15; __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_18[3] = __pyx_t_17; __pyx_t_10 = 13; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18[3]); #endif __pyx_t_11 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_11 |= __Pyx_PyUnicode_KIND_04(__pyx_t_18[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_18[3]); #endif __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_18, 4, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 1849, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_3 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_16, __pyx_t_19}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1847, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_ve); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(2, 1847, __pyx_L15_error) }
+1850: except BufferError as be:
__pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_BufferError)))); if (__pyx_t_20) { __Pyx_AddTraceback("questdb._client._dataframe_series_as_pybuf", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(2, 1850, __pyx_L6_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_v_be = __pyx_t_7; /*try:*/ { /* … */ /*finally:*/ { __pyx_L26_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22); if ( unlikely(__Pyx_GetException(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25); __Pyx_XGOTREF(__pyx_t_27); __Pyx_XGOTREF(__pyx_t_26); __Pyx_XGOTREF(__pyx_t_25); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_22); __pyx_t_20 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_21 = __pyx_filename; { __Pyx_DECREF(__pyx_v_be); __pyx_v_be = 0; } __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22); __Pyx_XGIVEREF(__pyx_t_27); __Pyx_XGIVEREF(__pyx_t_26); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ErrRestore(__pyx_t_27, __pyx_t_26, __pyx_t_25); __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_21; goto __pyx_L6_except_error; } } } goto __pyx_L6_except_error;
+1851: raise QuestDBError(
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 1851, __pyx_L26_error)
__Pyx_GOTREF(__pyx_t_19);
+1852: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1852, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1852, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+1853: f'Bad column {pandas_col.name!r}: Expected a buffer, got ' +
__pyx_t_16 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1853, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); /* … */ __pyx_t_10 = 39; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[5]); #endif __pyx_t_20 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_20 |= __Pyx_PyUnicode_KIND_04(__pyx_t_9[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[5]); #endif __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_9, 7, __pyx_t_10, __pyx_t_20); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1853, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_19))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_19); assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_19, __pyx__function); __pyx_t_3 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_15}; __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_19, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1851, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); }
+1854: f'{pandas_col.series!r} ({_fqn(type(pandas_col.series))})') from be
__pyx_t_17 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->series), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 1854, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_15 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_pandas_col->series)))); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1854, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_28 = __Pyx_PyUnicode_Unicode(__pyx_t_15); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 1854, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_9[1] = __pyx_t_16; __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_buffer_got; __pyx_t_9[3] = __pyx_t_17; __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__15; __pyx_t_9[5] = __pyx_t_28; __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u__11; /* … */ __Pyx_Raise(__pyx_t_8, 0, 0, __pyx_v_be); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(2, 1851, __pyx_L26_error) }
+1855: _dataframe_alloc_chunks(1, col)
__pyx_t_29 = __pyx_f_7questdb_7_client__dataframe_alloc_chunks(1, __pyx_v_col); if (unlikely(__pyx_t_29 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1855, __pyx_L1_error)
+1856: mapped = &col.setup.chunks.chunks[0]
__pyx_v_mapped = (&(__pyx_v_col->setup->chunks.chunks[0]));
1857:
1858: # Total number of elements.
+1859: mapped.length = (
__pyx_v_mapped->length = __Pyx_div_int64_t(((int64_t)__pyx_v_col->setup->pybuf.len), ((int64_t)__pyx_v_col->setup->pybuf.itemsize), 0);
+1860: <int64_t>col.setup.pybuf.len // <int64_t>col.setup.pybuf.itemsize)
if (unlikely(((int64_t)__pyx_v_col->setup->pybuf.itemsize) == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(2, 1860, __pyx_L1_error)
}
else if (sizeof(int64_t) == sizeof(long) && (!(((int64_t)-1) > 0)) && unlikely(((int64_t)__pyx_v_col->setup->pybuf.itemsize) == (int64_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(((int64_t)__pyx_v_col->setup->pybuf.len)))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
__PYX_ERR(2, 1860, __pyx_L1_error)
}
+1861: mapped.null_count = 0
__pyx_v_mapped->null_count = 0;
+1862: mapped.offset = 0
__pyx_v_mapped->offset = 0;
+1863: mapped.n_buffers = 2
__pyx_v_mapped->n_buffers = 2;
+1864: mapped.n_children = 0
__pyx_v_mapped->n_children = 0;
+1865: mapped.buffers = <const void**>calloc(2, sizeof(const void*))
__pyx_v_mapped->buffers = ((void const **)calloc(2, (sizeof(void const *))));
+1866: if mapped.buffers == NULL:
__pyx_t_5 = (__pyx_v_mapped->buffers == NULL);
if (unlikely(__pyx_t_5)) {
/* … */
}
+1867: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(2, 1867, __pyx_L1_error)
+1868: mapped.buffers[0] = NULL
(__pyx_v_mapped->buffers[0]) = NULL;
+1869: mapped.buffers[1] = <const void*>col.setup.pybuf.buf
(__pyx_v_mapped->buffers[1]) = ((void const *)__pyx_v_col->setup->pybuf.buf);
+1870: mapped.children = NULL
__pyx_v_mapped->children = NULL;
+1871: mapped.dictionary = NULL
__pyx_v_mapped->dictionary = NULL;
+1872: mapped.release = _dataframe_free_mapped_arrow # to cleanup allocated array.
__pyx_v_mapped->release = __pyx_f_7questdb_7_client__dataframe_free_mapped_arrow;
1873:
+1874: cdef list _dataframe_series_to_arrow_chunks(PandasCol pandas_col):
static PyObject *__pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col) {
PyObject *__pyx_v_array = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_series_to_arrow_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1875: cdef object array
+1876: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1877: array = _PYARROW.Array.from_pandas(pandas_col.series)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_Array); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_pandas_col->series}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_from_pandas, __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_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_array = __pyx_t_1; __pyx_t_1 = 0;
+1878: if isinstance(array, _PYARROW.ChunkedArray):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_ChunkedArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_IsInstance(__pyx_v_array, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 1878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* … */ }
+1879: return array.chunks
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_mstate_global->__pyx_n_u_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(2, 1879, __pyx_L1_error) { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_1); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L0;
1880: else:
+1881: return [array]
/*else*/ {
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1881, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_array);
__Pyx_GIVEREF(__pyx_v_array);
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_array) != (0)) __PYX_ERR(2, 1881, __pyx_L1_error);
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = ((PyObject*)__pyx_t_1);
}
__Pyx_XDECREF(__pyx_temp);
}
__pyx_t_1 = 0;
goto __pyx_L0;
}
1882:
1883:
+1884: cdef void_int _dataframe_export_arrow_chunks(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(PyObject *__pyx_v_chunks, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_n_chunks;
size_t __pyx_v_chunk_index;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_export_arrow_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1885: list chunks, col_t* col) except -1:
+1886: cdef size_t n_chunks = len(chunks)
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
__PYX_ERR(2, 1886, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_chunks); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 1886, __pyx_L1_error)
__pyx_v_n_chunks = __pyx_t_1;
1887: cdef size_t chunk_index
+1888: _dataframe_alloc_chunks(n_chunks, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_alloc_chunks(__pyx_v_n_chunks, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1888, __pyx_L1_error)
+1889: for chunk_index in range(n_chunks):
__pyx_t_3 = __pyx_v_n_chunks;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_chunk_index = __pyx_t_5;
+1890: if chunk_index == 0:
__pyx_t_6 = (__pyx_v_chunk_index == 0);
if (__pyx_t_6) {
/* … */
goto __pyx_L5;
}
+1891: chunks[chunk_index]._export_to_c(
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1891, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_chunks, __pyx_v_chunk_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = __pyx_t_9;
__Pyx_INCREF(__pyx_t_8);
+1892: <uintptr_t>&col.setup.chunks.chunks[chunk_index],
__pyx_t_10 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index])))); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+1893: <uintptr_t>&col.setup.arrow_schema)
__pyx_t_11 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&__pyx_v_col->setup->arrow_schema))); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_10, __pyx_t_11}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_export_to_c, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (1*__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_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1894: else:
+1895: chunks[chunk_index]._export_to_c(
/*else*/ {
if (unlikely(__pyx_v_chunks == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 1895, __pyx_L1_error)
}
__pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_chunks, __pyx_v_chunk_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 1895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_9 = __pyx_t_11;
__Pyx_INCREF(__pyx_t_9);
+1896: <uintptr_t>&col.setup.chunks.chunks[chunk_index])
__pyx_t_10 = __Pyx_PyLong_FromSize_t(((uintptr_t)(&(__pyx_v_col->setup->chunks.chunks[__pyx_v_chunk_index])))); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_export_to_c, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L5:; }
1897:
1898:
+1899: cdef void_int _dataframe_series_as_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_as_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("questdb._client._dataframe_series_as_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1900: PandasCol pandas_col,
1901: col_t* col) except -1:
+1902: _dataframe_export_arrow_chunks(
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(((PyObject*)__pyx_t_1), __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1903: _dataframe_series_to_arrow_chunks(pandas_col), col)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(__pyx_v_pandas_col); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1);
1904:
1905:
1906: # Canonical Apache Arrow extension name that claims a
1907: # `FixedSizeBinary(16)` column as a UUID whose bytes are RFC 4122
1908: # big-endian. The native client reads it from the exported schema's
1909: # `ARROW:extension:name` metadata.
+1910: cdef str _ARROW_EXT_UUID = 'arrow.uuid'
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_arrow_uuid); __Pyx_XGOTREF(__pyx_v_7questdb_7_client__ARROW_EXT_UUID); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__ARROW_EXT_UUID, __pyx_mstate_global->__pyx_kp_u_arrow_uuid); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_arrow_uuid);
1911:
1912:
1913: # polars exports its `Object` dtype as `fixed_size_binary(8)`: one 8-byte
1914: # handle to an object in its own process per cell, with no field or
1915: # schema metadata saying so, and it refuses to nest `Object` inside a
1916: # struct or list. Once the column has left polars -- through `to_arrow()`,
1917: # a `RecordBatchReader`, a wrapper's `__arrow_c_stream__`, or a pandas
1918: # `ArrowDtype` -- that top-level width is all there is to recognise it by.
1919: # The column-QWP routes therefore refuse every 8-byte fixed-size binary
1920: # column with `ArrowUnsupportedColumnKind`, the code 5.0 raises for the
1921: # same inputs; storing it would write meaningless BINARY blobs.
+1922: cdef const char* _ARROW_FMT_FSB8 = "w:8"
__pyx_v_7questdb_7_client__ARROW_FMT_FSB8 = __pyx_k_w_8;
+1923: cdef const char* _ARROW_FMT_STRUCT = "+s"
__pyx_v_7questdb_7_client__ARROW_FMT_STRUCT = __pyx_k_s_3;
1924:
1925: # The most top-level columns the native Arrow importer accepts. It mirrors
1926: # `MAX_ARROW_TOP_LEVEL_COLUMNS` in `questdb-rs-ffi/src/lib.rs`, which the
1927: # importer checks before it reads a single child pointer.
+1928: cdef int64_t _ARROW_MAX_TOP_LEVEL_COLUMNS = 4095
__pyx_v_7questdb_7_client__ARROW_MAX_TOP_LEVEL_COLUMNS = 0xFFF;
1929:
1930:
+1931: cdef str _polars_object_remedy(object name):
static PyObject *__pyx_f_7questdb_7_client__polars_object_remedy(PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._polars_object_remedy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1932: """How to write the values a polars `Object` column holds. The column
1933: may reach the client still in polars, or already converted to pyarrow
1934: or to a pandas `ArrowDtype`; either way the fix starts from the polars
1935: frame."""
1936: return (
+1937: f'For uuid.UUID or ipaddress.IPv4Address values, convert the '
__pyx_t_4 = 447; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]); #endif __pyx_t_5 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]); #endif __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_6); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_6 = 0; goto __pyx_L0;
1938: f'polars frame with `df.to_pandas()` (for a Series, '
1939: f'`series.to_frame().to_pandas()`), without a `types_mapper`, and '
1940: f'pass the result: its object column lands as UUID or IPV4. Or '
1941: f'convert the values in polars first: UUIDs to 16-byte '
+1942: f'`pl.Binary` with `schema_overrides={{{name!r}: \'uuid\'}}`, '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1);
1943: f'addresses to `pl.UInt32` with '
+1944: f'`schema_overrides={{{name!r}: \'ipv4\'}}`. Convert any other '
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_For_uuid_UUID_or_ipaddress_IPv4A; __pyx_t_3[1] = __pyx_t_1; __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_uuid_addresses_to_pl_UInt32_wit; __pyx_t_3[3] = __pyx_t_2; __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u_ipv4_Convert_any_other_objects;
1945: f'objects to a type QuestDB stores.')
1946:
1947:
+1948: cdef str _fsb8_refusal_message(object name):
static PyObject *__pyx_f_7questdb_7_client__fsb8_refusal_message(PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._fsb8_refusal_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
1949: return (
+1950: f'Bad column {name!r}: its values are 8 bytes each (Arrow type '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_its_values_are_8_bytes_each_Arr; __pyx_t_3 = 322; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1951: f'fixed_size_binary(8)), the shape polars exports its Object '
1952: f'dtype in: handles to objects in its own process rather than '
1953: f'data. Such a column is refused rather than stored as BINARY, '
1954: f'whatever its label. If it came from a polars Object column, '
1955: f'start from the polars frame. '
+1956: + _polars_object_remedy(name)
__pyx_t_1 = __pyx_f_7questdb_7_client__polars_object_remedy(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1957: + f' If it holds genuine 8-byte values, make it variable-length '
__pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_If_it_holds_genuine_8_byte_valu); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_1); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L0;
1958: f'binary (`pa.binary()`, `pl.Binary`, or a pandas object column '
1959: f'of `bytes`) to store it as BINARY. A UUID or LONG256 claim '
1960: f'needs 16- or 32-byte values.')
1961:
1962:
+1963: cdef void_int _refuse_fsb8_column(const ArrowSchema* col) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__refuse_fsb8_column(struct ArrowSchema const *__pyx_v_col) {
PyObject *__pyx_v_name = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("questdb._client._refuse_fsb8_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+1964: cdef str name = ''
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6);
__pyx_v_name = __pyx_mstate_global->__pyx_kp_u__6;
+1965: if col.format == NULL or strncmp(col.format, _ARROW_FMT_FSB8, 4) != 0:
__pyx_t_2 = (__pyx_v_col->format == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (strncmp(__pyx_v_col->format, __pyx_v_7questdb_7_client__ARROW_FMT_FSB8, 4) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+1966: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+1967: if col.name != NULL:
__pyx_t_1 = (__pyx_v_col->name != NULL);
if (__pyx_t_1) {
/* … */
}
+1968: name = (<bytes>col.name).decode('utf-8', 'replace')
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_col->name); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "decode"); __PYX_ERR(2, 1968, __pyx_L1_error) } __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_t_3), 0, PY_SSIZE_T_MAX, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0;
+1969: raise QuestDBError(
__pyx_t_3 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5);
+1970: QuestDBErrorCode.ArrowUnsupportedColumnKind,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ArrowUnsupportedColumnKind); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+1971: _fsb8_refusal_message(name))
__pyx_t_6 = __pyx_f_7questdb_7_client__fsb8_refusal_message(__pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); assert(__pyx_t_3); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_8 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_6}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 1969, __pyx_L1_error)
1972:
1973:
+1974: cdef void_int _refuse_fsb8_columns(const ArrowSchema* schema) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__refuse_fsb8_columns(struct ArrowSchema const *__pyx_v_schema) {
int64_t __pyx_v_i;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._refuse_fsb8_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
1975: """Refuse a top-level 8-byte fixed-size binary column in an exported
1976: Arrow stream schema.
1977:
1978: A struct root is a table, whose fields are its columns; that includes
1979: a struct-typed polars Series. Any other root is a single column, as a
1980: polars Series of another type exports. Comparing four bytes includes
1981: the terminator, so `"w:8"` matches exactly.
1982:
1983: The schema comes straight from the producer and the native importer
1984: has not validated it yet, so a declared child count is trusted only
1985: within the bound the importer itself enforces before reading any
1986: child. Outside it -- negative, or over the column cap -- this walk
1987: reads nothing and leaves the importer to refuse the schema."""
1988: cdef int64_t i
+1989: if (schema.format != NULL
__pyx_t_2 = (__pyx_v_schema->format != NULL);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+1990: and strncmp(schema.format, _ARROW_FMT_STRUCT, 3) == 0):
__pyx_t_2 = (strncmp(__pyx_v_schema->format, __pyx_v_7questdb_7_client__ARROW_FMT_STRUCT, 3) == 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:;
+1991: if (schema.children == NULL
__pyx_t_2 = (__pyx_v_schema->children == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+1992: or schema.n_children < 0
__pyx_t_2 = (__pyx_v_schema->n_children < 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
+1993: or schema.n_children > _ARROW_MAX_TOP_LEVEL_COLUMNS):
__pyx_t_2 = (__pyx_v_schema->n_children > __pyx_v_7questdb_7_client__ARROW_MAX_TOP_LEVEL_COLUMNS);
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
+1994: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+1995: for i in range(schema.n_children):
__pyx_t_3 = __pyx_v_schema->n_children;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
+1996: if schema.children[i] != NULL:
__pyx_t_1 = ((__pyx_v_schema->children[__pyx_v_i]) != NULL);
if (__pyx_t_1) {
/* … */
}
}
+1997: _refuse_fsb8_column(schema.children[i])
__pyx_t_6 = __pyx_f_7questdb_7_client__refuse_fsb8_column((__pyx_v_schema->children[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1997, __pyx_L1_error)
+1998: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+1999: return _refuse_fsb8_column(schema)
__pyx_t_6 = __pyx_f_7questdb_7_client__refuse_fsb8_column(__pyx_v_schema); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 1999, __pyx_L1_error)
{
__pyx_r = __pyx_t_6;
}
goto __pyx_L0;
2000:
2001:
2002: # Sixteen and thirty-two bytes are the two fixed-size binary widths that
2003: # mean something else in QuestDB: UUID and LONG256. Width alone decides
2004: # neither. A column says which through the `arrow.uuid` extension type
2005: # (16 bytes), `questdb.column_type` field metadata of `uuid` or `long256`,
2006: # `schema_overrides`, or a `df.attrs['questdb']` claim; with none of those
2007: # it is unlabelled. These are exactly the labels the native Arrow ingest
2008: # honours, so anything else -- another extension type, a misspelt
2009: # `questdb.column_type` such as `UUID` -- is unlabelled here too, rather
2010: # than taken as a label the native side then quietly writes as BINARY.
2011: #
2012: # What happens to an unlabelled one depends on where it came from, not on
2013: # which planner writes it. Any pandas frame refuses it: an `ArrowDtype`
2014: # holds a type and no field, so field metadata does not survive the trip
2015: # into pandas, and an unlabelled column there may be a UUID column whose
2016: # label was dropped on the way. Native Arrow input -- a `pa.Table`, a
2017: # `RecordBatch`, a reader, any `__arrow_c_stream__` producer -- keeps its
2018: # field metadata, so an unlabelled column there is taken at its word and
2019: # written as BINARY, with a `questdb` WARNING naming the remedies. Hash
2020: # columns read straight from Parquet or a database are common in that
2021: # shape, and refusing them would break pipelines that mean exactly that.
+2022: cdef const char* _ARROW_FMT_FSB16 = "w:16"
__pyx_v_7questdb_7_client__ARROW_FMT_FSB16 = __pyx_k_w_16;
+2023: cdef const char* _ARROW_FMT_FSB32 = "w:32"
__pyx_v_7questdb_7_client__ARROW_FMT_FSB32 = __pyx_k_w_32;
+2024: cdef const char* _ARROW_C_MD_COLUMN_TYPE = "questdb.column_type"
__pyx_v_7questdb_7_client__ARROW_C_MD_COLUMN_TYPE = __pyx_k_questdb_column_type;
+2025: cdef const char* _ARROW_C_MD_EXTENSION_NAME = "ARROW:extension:name"
__pyx_v_7questdb_7_client__ARROW_C_MD_EXTENSION_NAME = __pyx_k_ARROW_extension_name;
+2026: cdef const char* _ARROW_C_MD_UUID = "uuid"
__pyx_v_7questdb_7_client__ARROW_C_MD_UUID = __pyx_k_uuid;
+2027: cdef const char* _ARROW_C_MD_LONG256 = "long256"
__pyx_v_7questdb_7_client__ARROW_C_MD_LONG256 = __pyx_k_long256;
+2028: cdef const char* _ARROW_C_EXT_UUID = "arrow.uuid"
__pyx_v_7questdb_7_client__ARROW_C_EXT_UUID = __pyx_k_arrow_uuid;
+2029: cdef const char* _ARROW_C_MD_BINARY = "binary"
__pyx_v_7questdb_7_client__ARROW_C_MD_BINARY = __pyx_k_binary;
+2030: cdef const char* _ARROW_FMT_BINARY = "z"
__pyx_v_7questdb_7_client__ARROW_FMT_BINARY = __pyx_k_z;
+2031: cdef const char* _ARROW_FMT_LARGE_BINARY = "Z"
__pyx_v_7questdb_7_client__ARROW_FMT_LARGE_BINARY = __pyx_k_Z;
+2032: cdef const char* _ARROW_FMT_BINARY_VIEW = "vz"
__pyx_v_7questdb_7_client__ARROW_FMT_BINARY_VIEW = __pyx_k_vz;
2033:
2034:
+2035: cdef str _unlabelled_fsb32_message(object name):
static PyObject *__pyx_f_7questdb_7_client__unlabelled_fsb32_message(PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
/* … */
/* 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_7);
__Pyx_AddTraceback("questdb._client._unlabelled_fsb32_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2036: return (
+2037: f'Bad column {name!r}: its values are 32 bytes each (Arrow type '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* … */ __pyx_t_5 = 934; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[5]); #endif __pyx_t_6 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[5]); #endif __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_7); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_7 = 0; goto __pyx_L0;
2038: f'fixed_size_binary(32)). They could be LONG256 numbers or plain '
2039: f'binary data, and the column does not say which. To store '
2040: f'LONG256, do one of the following: pass '
+2041: f'`schema_overrides={{{name!r}: \'long256\'}}` to dataframe(), '
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2);
2042: f'which works only when every column of the DataFrame is '
2043: f'Arrow-backed, e.g. after '
2044: f'`df = df.convert_dtypes(dtype_backend="pyarrow")`; or pass '
2045: f'dataframe() a `pa.Table` or `pa.RecordBatch` instead of a '
2046: f'DataFrame, with `{{"questdb.column_type": "long256"}}` in this '
2047: f'column\'s field metadata (a pandas DataFrame cannot hold field '
2048: f'metadata). Each value is read as an unsigned integer, least '
2049: f'significant byte first, which is what '
2050: f'`value.to_bytes(32, \'little\')` produces. To store plain binary '
+2051: f'data, pass `schema_overrides={{{name!r}: \'binary\'}}`, which '
__pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_4[1] = __pyx_t_1; __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_its_values_are_32_bytes_each_Ar; __pyx_t_4[3] = __pyx_t_2; __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_long256_to_dataframe_which_work; __pyx_t_4[5] = __pyx_t_3; __pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u_binary_which_also_needs_every_c;
2052: f'also needs every column Arrow-backed; or make it variable-length '
2053: f'binary, `pd.ArrowDtype(pa.binary())`, or a column of Python '
2054: f'`bytes` objects.')
2055:
2056:
+2057: cdef str _unlabelled_fsb16_message(object name):
static PyObject *__pyx_f_7questdb_7_client__unlabelled_fsb16_message(PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._unlabelled_fsb16_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2058: return (
+2059: f'Bad column {name!r}: its values are 16 bytes each (Arrow type '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_its_values_are_16_bytes_each_Ar; __pyx_t_3 = 292; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2060: f'fixed_size_binary(16)). They could be UUIDs or plain binary '
2061: f'data, and the column does not say which. To store UUIDs, do one '
2062: f'of the following: make it a column of `uuid.UUID` objects; give '
2063: f'it the Arrow UUID type, `pd.ArrowDtype(pa.uuid())`'
+2064: + ('' if hasattr(_PYARROW, 'uuid')
__pyx_t_6 = __pyx_v_7questdb_7_client__PYARROW; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = __Pyx_HasAttr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_uuid); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 2064, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6); __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__6; } else { /* … */ __pyx_t_6 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2065: else f', which needs pyarrow 18 or newer (installed: '
__pyx_t_3 = 47;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]);
#endif
__pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2065, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_1 = __pyx_t_6;
__pyx_t_6 = 0;
}
+2066: f'{_PYARROW.__version__})')
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_version_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_which_needs_pyarrow_18_or_newer; __pyx_t_2[1] = __pyx_t_8; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__11;
+2067: + f'; or pass `schema_overrides={{{name!r}: \'uuid\'}}` to '
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* … */ __pyx_t_3 = 719; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9[3]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_9[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_9[3]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_9, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_5); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_5 = 0; goto __pyx_L0;
2068: f'dataframe(), which works only when every column of the '
2069: f'DataFrame is Arrow-backed, e.g. after '
2070: f'`df = df.convert_dtypes(dtype_backend="pyarrow")`. Raw UUID '
2071: f'bytes must be in the standard order (RFC 4122), which is what '
2072: f'`uuid.UUID.bytes` returns and `uuid.UUID(bytes=...)` expects. '
2073: f'If you produce them as `value.int.to_bytes(16, \'little\')`, the '
2074: f'order version 5.0 of this client expected, reverse each value '
2075: f'with `b[::-1]` first, or every UUID will be stored reversed. To '
2076: f'store plain binary data, pass '
+2077: f'`schema_overrides={{{name!r}: \'binary\'}}`, which also needs '
__pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_or_pass_schema_overrides; __pyx_t_9[1] = __pyx_t_1; __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_uuid_to_dataframe_which_works_o; __pyx_t_9[3] = __pyx_t_5; __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_binary_which_also_needs_every_c;
2078: f'every column Arrow-backed; or make it variable-length binary, '
2079: f'`pd.ArrowDtype(pa.binary())`, or a column of Python `bytes` '
2080: f'objects.')
2081:
2082:
+2083: cdef bint _arrow_metadata_holds(
static int __pyx_f_7questdb_7_client__arrow_metadata_holds(char const *__pyx_v_metadata, char const *__pyx_v_key, char const *__pyx_v_value) {
int32_t __pyx_v_n_pairs;
int32_t __pyx_v_key_len_here;
int32_t __pyx_v_value_len_here;
CYTHON_UNUSED int32_t __pyx_v_i;
size_t __pyx_v_key_len;
size_t __pyx_v_value_len;
char const *__pyx_v_key_here;
char const *__pyx_v_p;
int __pyx_v_holds;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
2084: const char* metadata, const char* key, const char* value) noexcept:
2085: """Whether an Arrow C-schema metadata blob maps `key` to exactly
2086: `value`.
2087:
2088: The blob is an int32 pair count followed, per pair, by an int32 key
2089: length, the key bytes, an int32 value length and the value bytes, in
2090: native byte order with no alignment promised, so each length is
2091: copied out rather than read in place. The blob comes from the
2092: producer as the native importer will read it; a negative count or
2093: length ends the walk without a match and leaves the importer to
2094: judge the schema."""
2095: cdef int32_t n_pairs
2096: cdef int32_t key_len_here
2097: cdef int32_t value_len_here
2098: cdef int32_t i
+2099: cdef size_t key_len = strlen(key)
__pyx_v_key_len = strlen(__pyx_v_key);
+2100: cdef size_t value_len = strlen(value)
__pyx_v_value_len = strlen(__pyx_v_value);
2101: cdef const char* key_here
+2102: cdef const char* p = metadata
__pyx_v_p = __pyx_v_metadata;
+2103: cdef bint holds = False
__pyx_v_holds = 0;
+2104: if metadata == NULL:
__pyx_t_1 = (__pyx_v_metadata == NULL);
if (__pyx_t_1) {
/* … */
}
+2105: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
+2106: memcpy(&n_pairs, p, sizeof(int32_t))
(void)(memcpy((&__pyx_v_n_pairs), __pyx_v_p, (sizeof(int32_t))));
+2107: p += sizeof(int32_t)
__pyx_v_p = (__pyx_v_p + (sizeof(int32_t)));
+2108: if n_pairs < 0:
__pyx_t_1 = (__pyx_v_n_pairs < 0);
if (__pyx_t_1) {
/* … */
}
+2109: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
+2110: for i in range(n_pairs):
__pyx_t_2 = __pyx_v_n_pairs;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
+2111: memcpy(&key_len_here, p, sizeof(int32_t))
(void)(memcpy((&__pyx_v_key_len_here), __pyx_v_p, (sizeof(int32_t))));
+2112: p += sizeof(int32_t)
__pyx_v_p = (__pyx_v_p + (sizeof(int32_t)));
+2113: if key_len_here < 0:
__pyx_t_1 = (__pyx_v_key_len_here < 0);
if (__pyx_t_1) {
/* … */
}
+2114: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
+2115: key_here = p
__pyx_v_key_here = __pyx_v_p;
+2116: p += key_len_here
__pyx_v_p = (__pyx_v_p + __pyx_v_key_len_here);
+2117: memcpy(&value_len_here, p, sizeof(int32_t))
(void)(memcpy((&__pyx_v_value_len_here), __pyx_v_p, (sizeof(int32_t))));
+2118: p += sizeof(int32_t)
__pyx_v_p = (__pyx_v_p + (sizeof(int32_t)));
+2119: if value_len_here < 0:
__pyx_t_1 = (__pyx_v_value_len_here < 0);
if (__pyx_t_1) {
/* … */
}
+2120: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
2121: # A producer may repeat a key. The native importer collects the
2122: # pairs into a map, so the last one wins there, and it wins here.
+2123: if (<size_t>key_len_here == key_len
__pyx_t_5 = (((size_t)__pyx_v_key_len_here) == __pyx_v_key_len);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L10_bool_binop_done;
}
/* … */
if (__pyx_t_1) {
/* … */
}
+2124: and memcmp(key_here, key, key_len) == 0):
__pyx_t_5 = (memcmp(__pyx_v_key_here, __pyx_v_key, __pyx_v_key_len) == 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L10_bool_binop_done:;
+2125: holds = (<size_t>value_len_here == value_len
__pyx_t_5 = (((size_t)__pyx_v_value_len_here) == __pyx_v_value_len);
if (__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L12_bool_binop_done;
}
+2126: and memcmp(p, value, value_len) == 0)
__pyx_t_5 = (memcmp(__pyx_v_p, __pyx_v_value, __pyx_v_value_len) == 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L12_bool_binop_done:;
__pyx_v_holds = __pyx_t_1;
+2127: p += value_len_here
__pyx_v_p = (__pyx_v_p + __pyx_v_value_len_here); }
+2128: return holds
{
__pyx_r = __pyx_v_holds;
}
goto __pyx_L0;
2129:
2130:
+2131: cdef bint _arrow_overrides_name(
static int __pyx_f_7questdb_7_client__arrow_overrides_name(struct qwp_arrow_override const *__pyx_v_overrides, size_t __pyx_v_overrides_len, char const *__pyx_v_name, size_t __pyx_v_name_len) {
size_t __pyx_v_i;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
2132: const qwp_arrow_override* overrides,
2133: size_t overrides_len,
2134: const char* name,
2135: size_t name_len) noexcept:
2136: cdef size_t i
+2137: for i in range(overrides_len):
__pyx_t_1 = __pyx_v_overrides_len;
__pyx_t_2 = __pyx_t_1;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
+2138: if (overrides[i].column_len == name_len
__pyx_t_5 = ((__pyx_v_overrides[__pyx_v_i]).column_len == __pyx_v_name_len);
if (__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L6_bool_binop_done;
}
/* … */
if (__pyx_t_4) {
/* … */
}
}
+2139: and memcmp(overrides[i].column, name, name_len) == 0):
__pyx_t_5 = (memcmp((__pyx_v_overrides[__pyx_v_i]).column, __pyx_v_name, __pyx_v_name_len) == 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L6_bool_binop_done:;
+2140: return True
{
__pyx_r = 1;
}
goto __pyx_L0;
+2141: return False
{
__pyx_r = 0;
}
goto __pyx_L0;
2142:
2143:
+2144: cdef void_int _log_unlabelled_fsb_columns(object unlabelled) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__log_unlabelled_fsb_columns(PyObject *__pyx_v_unlabelled) {
PyObject *__pyx_v_name = 0;
int __pyx_v_width;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_AddTraceback("questdb._client._log_unlabelled_fsb_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2145: """Log a `questdb` WARNING for each `(name, width)` the schema walk
2146: collected.
2147:
2148: Called once the write has gone through and its connection is
2149: closed: a logging handler is caller Python, and running it after the
2150: native state is gone keeps it from re-entering a write that is still
2151: in progress. A diagnostic about a write that went ahead, so it stays
2152: out of `warnings.warn`, which `-W error` would turn into an error."""
2153: cdef object name
2154: cdef int width
+2155: if not unlabelled:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_unlabelled); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 2155, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* … */ }
+2156: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2157: for name, width in unlabelled:
if (likely(PyList_CheckExact(__pyx_v_unlabelled)) || PyTuple_CheckExact(__pyx_v_unlabelled)) { __pyx_t_3 = __pyx_v_unlabelled; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_unlabelled); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2157, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { 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(2, 2157, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } 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(2, 2157, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4)); #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); #endif ++__pyx_t_4; } if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2157, __pyx_L1_error) } else { __pyx_t_6 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 2157, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_6); if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(2, 2157, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(2, 2157, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(2, 2157, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 2157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7); __pyx_t_7 = 0; __pyx_v_width = __pyx_t_11; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2158: if width == 16:
__pyx_t_2 = (__pyx_v_width == 16);
if (__pyx_t_2) {
/* … */
goto __pyx_L8;
}
+2159: logging.getLogger('questdb').warning(
__pyx_t_9 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_14 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_13))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
assert(__pyx_t_9);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
__pyx_t_14 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_questdb};
__pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_8 = __pyx_t_7;
__Pyx_INCREF(__pyx_t_8);
2160: 'questdb: column %r is fixed_size_binary(16) and nothing '
2161: 'labels it as UUID, so it was written as BINARY. If it '
2162: 'holds UUIDs, give it the type pa.uuid(), put '
2163: '{"questdb.column_type": "uuid"} in its field metadata, or '
2164: 'pass schema_overrides={%r: \'uuid\'}; the bytes must be in '
2165: 'RFC 4122 order, which uuid.UUID.bytes gives. If it holds '
2166: 'plain binary data, say so to write it without this '
2167: 'warning: {"questdb.column_type": "binary"} in its field '
2168: 'metadata, or schema_overrides={%r: \'binary\'}.',
+2169: name, name, name)
__pyx_t_14 = 0;
{
PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_questdb_column_r_is_fixed_size_b, __pyx_v_name, __pyx_v_name, __pyx_v_name};
__pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_warning, __pyx_callargs+__pyx_t_14, (5-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2170: else:
+2171: logging.getLogger('questdb').warning(
/*else*/ {
__pyx_t_13 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_14 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_12))) {
__pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
assert(__pyx_t_13);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
__pyx_t_14 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_n_u_questdb};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
}
__pyx_t_7 = __pyx_t_8;
__Pyx_INCREF(__pyx_t_7);
2172: 'questdb: column %r is fixed_size_binary(32) and nothing '
2173: 'labels it as LONG256, so it was written as BINARY. If it '
2174: 'holds LONG256 numbers, put '
2175: '{"questdb.column_type": "long256"} in its field metadata '
2176: 'or pass schema_overrides={%r: \'long256\'}; each value is '
2177: 'read as an unsigned integer, least significant byte first. '
2178: 'If it holds plain binary data, say so to write it without '
2179: 'this warning: {"questdb.column_type": "binary"} in its '
2180: 'field metadata, or schema_overrides={%r: \'binary\'}.',
+2181: name, name, name)
__pyx_t_14 = 0;
{
PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_questdb_column_r_is_fixed_size_b_2, __pyx_v_name, __pyx_v_name, __pyx_v_name};
__pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_warning, __pyx_callargs+__pyx_t_14, (5-__pyx_t_14) | (1*__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(2, 2171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__pyx_L8:;
+2182: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2183:
2184:
2185: # Arrow C format strings by the name the native ingest's errors give the
2186: # type (arrow-rs `DataType` debug names), so a refusal made here reads the
2187: # way the native side's own refusal of the same mistake reads.
2188: cdef dict _ARROW_FORMAT_TYPE_NAMES = {
+2189: 'n': 'Null', 'b': 'Boolean',
__pyx_t_16 = __Pyx_PyDict_NewPresized(23); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_Null) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_b, __pyx_mstate_global->__pyx_n_u_Boolean) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_c, __pyx_mstate_global->__pyx_n_u_Int8) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_C, __pyx_mstate_global->__pyx_n_u_UInt8) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_Int16) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_S, __pyx_mstate_global->__pyx_n_u_UInt16) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_i, __pyx_mstate_global->__pyx_n_u_Int32) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_n_u_UInt32) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_l, __pyx_mstate_global->__pyx_n_u_Int64) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_L, __pyx_mstate_global->__pyx_n_u_UInt64) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_e, __pyx_mstate_global->__pyx_n_u_Float16) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_f, __pyx_mstate_global->__pyx_n_u_Float32) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_g, __pyx_mstate_global->__pyx_n_u_Float64) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_u_2, __pyx_mstate_global->__pyx_n_u_Utf8) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_U, __pyx_mstate_global->__pyx_n_u_LargeUtf8) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_vu, __pyx_mstate_global->__pyx_n_u_Utf8View) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_tdD, __pyx_mstate_global->__pyx_n_u_Date32) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_tdm, __pyx_mstate_global->__pyx_n_u_Date64) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_l_2, __pyx_mstate_global->__pyx_n_u_List) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_L_2, __pyx_mstate_global->__pyx_n_u_LargeList) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_vl, __pyx_mstate_global->__pyx_n_u_ListView) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_s_3, __pyx_mstate_global->__pyx_n_u_Struct) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_kp_u_m, __pyx_mstate_global->__pyx_n_u_Map) < (0)) __PYX_ERR(2, 2189, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_7questdb_7_client__ARROW_FORMAT_TYPE_NAMES); __Pyx_DECREF_SET(__pyx_v_7questdb_7_client__ARROW_FORMAT_TYPE_NAMES, ((PyObject*)__pyx_t_16)); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = 0;
2190: 'c': 'Int8', 'C': 'UInt8', 's': 'Int16', 'S': 'UInt16',
2191: 'i': 'Int32', 'I': 'UInt32', 'l': 'Int64', 'L': 'UInt64',
2192: 'e': 'Float16', 'f': 'Float32', 'g': 'Float64',
2193: 'u': 'Utf8', 'U': 'LargeUtf8', 'vu': 'Utf8View',
2194: 'tdD': 'Date32', 'tdm': 'Date64',
2195: '+l': 'List', '+L': 'LargeList', '+vl': 'ListView', '+s': 'Struct',
2196: '+m': 'Map',
2197: }
2198:
2199: cdef tuple _ARROW_FORMAT_PREFIX_TYPE_NAMES = (
+2200: ('ts', 'Timestamp'), ('tt', 'Time'), ('tD', 'Duration'),
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_ts, __pyx_mstate_global->__pyx_n_u_Timestamp};
__pyx_mstate_global->__pyx_tuple[41] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[41])) __PYX_ERR(2, 2200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[41]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[41]);
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_tt, __pyx_mstate_global->__pyx_n_u_Time};
__pyx_mstate_global->__pyx_tuple[42] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[42])) __PYX_ERR(2, 2200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[42]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[42]);
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_tD, __pyx_mstate_global->__pyx_n_u_Duration};
__pyx_mstate_global->__pyx_tuple[43] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[43])) __PYX_ERR(2, 2200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[43]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[43]);
/* … */
__Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[47]);
__Pyx_XGOTREF(__pyx_v_7questdb_7_client__ARROW_FORMAT_PREFIX_TYPE_NAMES);
__Pyx_DECREF_SET(__pyx_v_7questdb_7_client__ARROW_FORMAT_PREFIX_TYPE_NAMES, __pyx_mstate_global->__pyx_tuple[47]);
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[47]);
/* … */
{
PyObject* __pyx_temp[6] = {__pyx_mstate_global->__pyx_tuple[41], __pyx_mstate_global->__pyx_tuple[42], __pyx_mstate_global->__pyx_tuple[43], __pyx_mstate_global->__pyx_tuple[44], __pyx_mstate_global->__pyx_tuple[45], __pyx_mstate_global->__pyx_tuple[46]};
__pyx_mstate_global->__pyx_tuple[47] = __Pyx_PyTuple_FromArray(__pyx_temp, 6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[47])) __PYX_ERR(2, 2200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[47]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[47]);
+2201: ('ti', 'Interval'), ('d:', 'Decimal'), ('+w:', 'FixedSizeList'),
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_ti, __pyx_mstate_global->__pyx_n_u_Interval};
__pyx_mstate_global->__pyx_tuple[44] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[44])) __PYX_ERR(2, 2201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[44]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[44]);
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_d, __pyx_mstate_global->__pyx_n_u_Decimal};
__pyx_mstate_global->__pyx_tuple[45] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[45])) __PYX_ERR(2, 2201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[45]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[45]);
{
PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_w_2, __pyx_mstate_global->__pyx_n_u_FixedSizeList};
__pyx_mstate_global->__pyx_tuple[46] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[46])) __PYX_ERR(2, 2201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[46]);
}
__Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[46]);
2202: )
2203:
2204:
+2205: cdef str _arrow_type_name(const ArrowSchema* col):
static PyObject *__pyx_f_7questdb_7_client__arrow_type_name(struct ArrowSchema const *__pyx_v_col) {
PyObject *__pyx_v_fmt = 0;
PyObject *__pyx_v_prefix = 0;
PyObject *__pyx_v_type_name = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("questdb._client._arrow_type_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_fmt);
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XDECREF(__pyx_v_type_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2206: """A readable name for a column's Arrow type: the arrow-rs name for
2207: the common types, the format string itself otherwise. A dictionary
2208: column's format is its index type, so it is named by the dictionary
2209: instead."""
2210: cdef str fmt
2211: cdef str prefix
2212: cdef str type_name
+2213: if col.dictionary != NULL:
__pyx_t_1 = (__pyx_v_col->dictionary != NULL);
if (__pyx_t_1) {
/* … */
}
+2214: return 'Dictionary'
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Dictionary);
__pyx_r = __pyx_mstate_global->__pyx_n_u_Dictionary;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+2215: fmt = (<bytes>col.format).decode('utf-8', 'replace')
__pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_col->format); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__pyx_t_2 == Py_None)) { PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "decode"); __PYX_ERR(2, 2215, __pyx_L1_error) } __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_t_2), 0, PY_SSIZE_T_MAX, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fmt = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+2216: type_name = _ARROW_FORMAT_TYPE_NAMES.get(fmt)
if (unlikely(__pyx_v_7questdb_7_client__ARROW_FORMAT_TYPE_NAMES == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "get");
__PYX_ERR(2, 2216, __pyx_L1_error)
}
__pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_7questdb_7_client__ARROW_FORMAT_TYPE_NAMES, __pyx_v_fmt, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(2, 2216, __pyx_L1_error)
__pyx_v_type_name = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
+2217: if type_name is not None:
__pyx_t_1 = (__pyx_v_type_name != ((PyObject*)Py_None));
if (__pyx_t_1) {
/* … */
}
+2218: return type_name
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_type_name);
__pyx_r = __pyx_v_type_name;
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+2219: for prefix, type_name in _ARROW_FORMAT_PREFIX_TYPE_NAMES:
if (unlikely(__pyx_v_7questdb_7_client__ARROW_FORMAT_PREFIX_TYPE_NAMES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable");
__PYX_ERR(2, 2219, __pyx_L1_error)
}
__pyx_t_3 = __pyx_v_7questdb_7_client__ARROW_FORMAT_PREFIX_TYPE_NAMES; __Pyx_INCREF(__pyx_t_3);
__pyx_t_4 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 2219, __pyx_L1_error)
#endif
if (__pyx_t_4 >= __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_4));
#else
__pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
#endif
++__pyx_t_4;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(2, 2219, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__Pyx_INCREF(__pyx_t_5);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
__Pyx_INCREF(__pyx_t_6);
} else {
__pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_XGOTREF(__pyx_t_6);
}
#else
__pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < (0)) __PYX_ERR(2, 2219, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(2, 2219, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(2, 2219, __pyx_L1_error)
if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(2, 2219, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_prefix, ((PyObject*)__pyx_t_5));
__pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_type_name, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
/* … */
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+2220: if fmt.startswith(prefix):
__pyx_t_1 = __Pyx_PyUnicode_Tailmatch(__pyx_v_fmt, __pyx_v_prefix, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 2220, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+2221: return type_name
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__Pyx_INCREF(__pyx_v_type_name);
__pyx_r = __pyx_v_type_name;
}
__Pyx_XDECREF(__pyx_temp);
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L0;
+2222: return f'with format {fmt!r}'
__pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fmt), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_with_format, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_2); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_2 = 0; goto __pyx_L0;
2223:
2224:
+2225: cdef bint _arrow_format_is_binary(const char* fmt) noexcept:
static int __pyx_f_7questdb_7_client__arrow_format_is_binary(char const *__pyx_v_fmt) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
2226: """Whether an Arrow format string is one of the binary types:
2227: fixed-size (`w:N`), variable-length (`z`), large (`Z`) or a view
2228: (`vz`). Comparing the terminator too makes each match exact."""
+2229: return (strncmp(fmt, "w:", 2) == 0
__pyx_t_2 = (strncmp(__pyx_v_fmt, __pyx_k_w, 2) == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2230: or strncmp(fmt, _ARROW_FMT_BINARY, 2) == 0
__pyx_t_2 = (strncmp(__pyx_v_fmt, __pyx_v_7questdb_7_client__ARROW_FMT_BINARY, 2) == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2231: or strncmp(fmt, _ARROW_FMT_LARGE_BINARY, 2) == 0
__pyx_t_2 = (strncmp(__pyx_v_fmt, __pyx_v_7questdb_7_client__ARROW_FMT_LARGE_BINARY, 2) == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2232: or strncmp(fmt, _ARROW_FMT_BINARY_VIEW, 3) == 0)
__pyx_t_2 = (strncmp(__pyx_v_fmt, __pyx_v_7questdb_7_client__ARROW_FMT_BINARY_VIEW, 3) == 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L3_bool_binop_done:;
{
__pyx_r = __pyx_t_1;
}
goto __pyx_L0;
2233:
2234:
+2235: cdef void_int _check_fsb_column(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__check_fsb_column(struct ArrowSchema const *__pyx_v_col, struct qwp_arrow_override const *__pyx_v_overrides, size_t __pyx_v_overrides_len, PyObject *__pyx_v_binary_names, PyObject *__pyx_v_seen_binary_names, PyObject *__pyx_v_unlabelled) {
int __pyx_v_width;
int __pyx_v_labelled_as_wide_type;
PyObject *__pyx_v_name_bytes = 0;
PyObject *__pyx_v_name = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._check_fsb_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name_bytes);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2236: const ArrowSchema* col,
2237: const qwp_arrow_override* overrides,
2238: size_t overrides_len,
2239: object binary_names,
2240: object seen_binary_names,
2241: object unlabelled) except -1:
+2242: cdef int width = 0
__pyx_v_width = 0;
+2243: cdef bint labelled_as_wide_type = False
__pyx_v_labelled_as_wide_type = 0;
+2244: cdef bytes name_bytes = b''
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
__pyx_v_name_bytes = __pyx_mstate_global->__pyx_kp_b__6;
2245: cdef str name
+2246: if col.format == NULL:
__pyx_t_1 = (__pyx_v_col->format == NULL);
if (__pyx_t_1) {
/* … */
}
+2247: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2248: # Five bytes include the terminator, so `"w:16"` matches exactly.
+2249: if strncmp(col.format, _ARROW_FMT_FSB16, 5) == 0:
__pyx_t_1 = (strncmp(__pyx_v_col->format, __pyx_v_7questdb_7_client__ARROW_FMT_FSB16, 5) == 0);
if (__pyx_t_1) {
/* … */
goto __pyx_L4;
}
+2250: width = 16
__pyx_v_width = 16;
2251: labelled_as_wide_type = (
+2252: _arrow_metadata_holds(
__pyx_t_2 = __pyx_f_7questdb_7_client__arrow_metadata_holds(__pyx_v_col->metadata, __pyx_v_7questdb_7_client__ARROW_C_MD_COLUMN_TYPE, __pyx_v_7questdb_7_client__ARROW_C_MD_UUID);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
2253: col.metadata, _ARROW_C_MD_COLUMN_TYPE, _ARROW_C_MD_UUID)
+2254: or _arrow_metadata_holds(
__pyx_t_2 = __pyx_f_7questdb_7_client__arrow_metadata_holds(__pyx_v_col->metadata, __pyx_v_7questdb_7_client__ARROW_C_MD_EXTENSION_NAME, __pyx_v_7questdb_7_client__ARROW_C_EXT_UUID);
__pyx_t_1 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
__pyx_v_labelled_as_wide_type = __pyx_t_1;
2255: col.metadata, _ARROW_C_MD_EXTENSION_NAME,
2256: _ARROW_C_EXT_UUID))
+2257: elif strncmp(col.format, _ARROW_FMT_FSB32, 5) == 0:
__pyx_t_1 = (strncmp(__pyx_v_col->format, __pyx_v_7questdb_7_client__ARROW_FMT_FSB32, 5) == 0);
if (__pyx_t_1) {
/* … */
}
__pyx_L4:;
+2258: width = 32
__pyx_v_width = 32;
+2259: labelled_as_wide_type = _arrow_metadata_holds(
__pyx_v_labelled_as_wide_type = __pyx_f_7questdb_7_client__arrow_metadata_holds(__pyx_v_col->metadata, __pyx_v_7questdb_7_client__ARROW_C_MD_COLUMN_TYPE, __pyx_v_7questdb_7_client__ARROW_C_MD_LONG256);
2260: col.metadata, _ARROW_C_MD_COLUMN_TYPE, _ARROW_C_MD_LONG256)
+2261: if binary_names:
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_binary_names); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 2261, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+2262: if col.name != NULL:
__pyx_t_1 = (__pyx_v_col->name != NULL);
if (__pyx_t_1) {
/* … */
}
+2263: name_bytes = <bytes>col.name
__pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_col->name); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_name_bytes, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0;
+2264: if name_bytes in binary_names:
__pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name_bytes, __pyx_v_binary_names, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 2264, __pyx_L1_error) if (__pyx_t_1) { /* … */ }
+2265: seen_binary_names.add(name_bytes)
__pyx_t_3 = __pyx_v_seen_binary_names;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name_bytes};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add, __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_4)) __PYX_ERR(2, 2265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+2266: name = name_bytes.decode('utf-8', 'replace')
if (unlikely(__pyx_v_name_bytes == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "decode");
__PYX_ERR(2, 2266, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_decode_bytes(__pyx_v_name_bytes, 0, PY_SSIZE_T_MAX, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_name = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+2267: if (col.dictionary != NULL
__pyx_t_2 = (__pyx_v_col->dictionary != NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L11_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_1)) {
/* … */
}
+2268: or not _arrow_format_is_binary(col.format)):
__pyx_t_2 = (!__pyx_f_7questdb_7_client__arrow_format_is_binary(__pyx_v_col->format));
__pyx_t_1 = __pyx_t_2;
__pyx_L11_bool_binop_done:;
+2269: raise QuestDBError(
__pyx_t_3 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
+2270: QuestDBErrorCode.ArrowIngest,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ArrowIngest); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+2271: f"override 'binary' is not applicable to column "
__pyx_t_12 = 97;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
#endif
__pyx_t_13 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_13 |= __Pyx_PyUnicode_KIND_04(__pyx_t_11[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_11[3]);
#endif
__pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_12, __pyx_t_13);
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_8, __pyx_t_9};
__pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(2, 2269, __pyx_L1_error)
+2272: f"{name!r} of Arrow type {_arrow_type_name(col)}: it "
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __pyx_f_7questdb_7_client__arrow_type_name(__pyx_v_col); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_override_binary_is_not_applicabl; __pyx_t_11[1] = __pyx_t_7; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_of_Arrow_type; __pyx_t_11[3] = __pyx_t_10; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_it_applies_to_binary_columns_on;
2273: f"applies to binary columns only.")
+2274: if labelled_as_wide_type:
if (unlikely(__pyx_v_labelled_as_wide_type)) {
/* … */
}
2275: # The native ingest honours the column's own label over
2276: # an override it never receives, so the two cannot both
2277: # stand.
+2278: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
+2279: QuestDBErrorCode.ArrowIngest,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ArrowIngest); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2280: f"override 'binary' on column {name!r} conflicts with "
__pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* … */ __pyx_t_12 = 124; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]); #endif __pyx_t_13 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 |= __Pyx_PyUnicode_KIND_04(__pyx_t_11[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_11[3]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); __pyx_t_5 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_10}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 2278, __pyx_L1_error)
2281: f"the column's own "
+2282: f"{'UUID' if width == 16 else 'LONG256'} label (its "
__pyx_t_1 = (__pyx_v_width == 16);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_UUID);
__pyx_t_10 = __pyx_mstate_global->__pyx_n_u_UUID;
} else {
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_LONG256);
__pyx_t_10 = __pyx_mstate_global->__pyx_n_u_LONG256;
}
__pyx_t_7 = __Pyx_PyUnicode_Unicode(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_override_binary_on_column;
__pyx_t_11[1] = __pyx_t_8;
__pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_conflicts_with_the_column_s_own;
__pyx_t_11[3] = __pyx_t_7;
__pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_label_its_Arrow_type_or_field_m;
2283: f"Arrow type or field metadata). Drop one of the two.")
+2284: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2285: if width == 0 or labelled_as_wide_type:
__pyx_t_2 = (__pyx_v_width == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_1 = __pyx_v_labelled_as_wide_type;
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+2286: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2287: if _arrow_metadata_holds(
__pyx_t_1 = __pyx_f_7questdb_7_client__arrow_metadata_holds(__pyx_v_col->metadata, __pyx_v_7questdb_7_client__ARROW_C_MD_COLUMN_TYPE, __pyx_v_7questdb_7_client__ARROW_C_MD_BINARY);
if (__pyx_t_1) {
/* … */
}
2288: col.metadata, _ARROW_C_MD_COLUMN_TYPE, _ARROW_C_MD_BINARY):
+2289: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2290: if col.name != NULL and _arrow_overrides_name(
__pyx_t_2 = (__pyx_v_col->name != NULL);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L19_bool_binop_done;
}
/* … */
__pyx_t_2 = __pyx_f_7questdb_7_client__arrow_overrides_name(__pyx_v_overrides, __pyx_v_overrides_len, __pyx_v_col->name, strlen(__pyx_v_col->name));
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
/* … */
if (__pyx_t_1) {
/* … */
}
2291: overrides, overrides_len, col.name, strlen(col.name)):
+2292: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2293: if unlabelled is not None:
__pyx_t_1 = (__pyx_v_unlabelled != Py_None);
if (__pyx_t_1) {
/* … */
}
+2294: unlabelled.append((
__pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_unlabelled, __pyx_t_9); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(2, 2294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+2295: (<bytes>col.name).decode('utf-8', 'replace')
__pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_col->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__pyx_t_9 == Py_None)) { PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "decode"); __PYX_ERR(2, 2295, __pyx_L1_error) } __pyx_t_10 = __Pyx_decode_bytes(((PyObject*)__pyx_t_9), 0, PY_SSIZE_T_MAX, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __pyx_t_10; __pyx_t_10 = 0; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6); __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u__6; } /* … */ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 2295, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(2, 2295, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_10 = 0;
+2296: if col.name != NULL else '',
__pyx_t_1 = (__pyx_v_col->name != NULL);
if (__pyx_t_1) {
+2297: width))
__pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_width); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+2298: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2299:
2300:
+2301: cdef void_int _check_fsb_columns(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__check_fsb_columns(struct ArrowSchema const *__pyx_v_schema, struct qwp_arrow_override const *__pyx_v_overrides, size_t __pyx_v_overrides_len, PyObject *__pyx_v_binary_names, PyObject *__pyx_v_unlabelled) {
int64_t __pyx_v_i;
PyObject *__pyx_v_seen_binary_names = 0;
PyObject *__pyx_v_missing = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("questdb._client._check_fsb_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_seen_binary_names);
__Pyx_XDECREF(__pyx_v_missing);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2302: const ArrowSchema* schema,
2303: const qwp_arrow_override* overrides,
2304: size_t overrides_len,
2305: object binary_names,
2306: object unlabelled) except -1:
2307: """Check every top-level column of an Arrow stream schema against
2308: the fixed-size binary labelling rules.
2309:
2310: Refuses a `'binary'` schema override that names no column, names a
2311: column that is not binary, or names one that already carries a UUID
2312: or LONG256 label; that override never reaches the native ingest, so
2313: the checks it would make fall to this walk. Appends `(name, width)`
2314: to `unlabelled`, when given, for each 16- or 32-byte column nothing
2315: labels, for `_log_unlabelled_fsb_columns` to report once the write is
2316: done. A pandas frame never has one by then: the capsule path refuses
2317: it first (`_refuse_unlabelled_fsb_pandas_columns`). The walk bounds
2318: the child count the way `_refuse_fsb8_columns` does."""
2319: cdef int64_t i
+2320: cdef set seen_binary_names = set()
__pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen_binary_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
2321: cdef object missing
+2322: if (schema.format != NULL
__pyx_t_3 = (__pyx_v_schema->format != NULL);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
/* … */
if (__pyx_t_2) {
/* … */
goto __pyx_L3;
}
+2323: and strncmp(schema.format, _ARROW_FMT_STRUCT, 3) == 0):
__pyx_t_3 = (strncmp(__pyx_v_schema->format, __pyx_v_7questdb_7_client__ARROW_FMT_STRUCT, 3) == 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:;
+2324: if (schema.children == NULL
__pyx_t_3 = (__pyx_v_schema->children == NULL);
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
/* … */
if (__pyx_t_2) {
/* … */
}
+2325: or schema.n_children < 0
__pyx_t_3 = (__pyx_v_schema->n_children < 0);
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
+2326: or schema.n_children > _ARROW_MAX_TOP_LEVEL_COLUMNS):
__pyx_t_3 = (__pyx_v_schema->n_children > __pyx_v_7questdb_7_client__ARROW_MAX_TOP_LEVEL_COLUMNS);
__pyx_t_2 = __pyx_t_3;
__pyx_L7_bool_binop_done:;
+2327: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2328: for i in range(schema.n_children):
__pyx_t_4 = __pyx_v_schema->n_children;
__pyx_t_5 = __pyx_t_4;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
+2329: if schema.children[i] != NULL:
__pyx_t_2 = ((__pyx_v_schema->children[__pyx_v_i]) != NULL);
if (__pyx_t_2) {
/* … */
}
}
+2330: _check_fsb_column(
__pyx_t_7 = __pyx_f_7questdb_7_client__check_fsb_column((__pyx_v_schema->children[__pyx_v_i]), __pyx_v_overrides, __pyx_v_overrides_len, __pyx_v_binary_names, __pyx_v_seen_binary_names, __pyx_v_unlabelled); if (unlikely(__pyx_t_7 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2330, __pyx_L1_error)
2331: schema.children[i], overrides, overrides_len,
2332: binary_names, seen_binary_names, unlabelled)
2333: else:
+2334: _check_fsb_column(
/*else*/ {
/* … */
__pyx_t_7 = __pyx_f_7questdb_7_client__check_fsb_column(__pyx_v_schema, __pyx_v_overrides, __pyx_v_overrides_len, __pyx_v_binary_names, __pyx_v_seen_binary_names, __pyx_v_unlabelled); if (unlikely(__pyx_t_7 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2334, __pyx_L1_error)
}
__pyx_L3:;
2335: schema, overrides, overrides_len,
2336: binary_names, seen_binary_names, unlabelled)
+2337: if binary_names:
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_binary_names); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2337, __pyx_L1_error) if (__pyx_t_2) { /* … */ }
+2338: missing = sorted(set(binary_names) - seen_binary_names)
__pyx_t_1 = PySet_New(__pyx_v_binary_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_v_seen_binary_names); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely((PyList_Sort(__pyx_t_1) < 0))) __PYX_ERR(2, 2338, __pyx_L1_error) __pyx_v_missing = __pyx_t_1; __pyx_t_1 = 0;
+2339: if missing:
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2339, __pyx_L1_error) if (unlikely(__pyx_t_2)) { /* … */ }
+2340: raise QuestDBError(
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
+2341: QuestDBErrorCode.ArrowIngest,
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ArrowIngest); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+2342: f"override targets unknown column "
__pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_override_targets_unknown_column, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 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_13 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2340, __pyx_L1_error)
+2343: f"{missing[0].decode('utf-8', 'replace')!r}")
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_missing, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_decode); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[5], NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_10), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* … */ { PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_utf_8, __pyx_mstate_global->__pyx_n_u_replace}; __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(2, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]); } __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
+2344: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2345:
2346:
+2347: cdef void_int _refuse_unlabelled_fsb_pandas_columns(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__refuse_unlabelled_fsb_pandas_columns(PyObject *__pyx_v_df, PyObject *__pyx_v_dtypes, PyObject *__pyx_v_overrides) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_dtype = 0;
PyObject *__pyx_v_arrowtype = 0;
PyObject *__pyx_v_ext_name = 0;
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_v_labelled = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
__Pyx_AddTraceback("questdb._client._refuse_unlabelled_fsb_pandas_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XDECREF(__pyx_v_arrowtype);
__Pyx_XDECREF(__pyx_v_ext_name);
__Pyx_XDECREF(__pyx_v_entry);
__Pyx_XDECREF(__pyx_v_labelled);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2348: object df, object dtypes, object overrides) except -1:
2349: """Refuse a pandas frame's unlabelled 16- or 32-byte column on the
2350: Arrow capsule path, before any connection is opened.
2351:
2352: `dtypes` is the frame's `df.dtypes` plus its exported index levels
2353: (`_pandas_export_dtypes`), built once by the caller and shared with
2354: the claim lookup. `overrides` is the merged
2355: list of `(name_bytes, kind, arg)` the capsule path holds:
2356: `schema_overrides` (`'binary'` included), `symbols` and the frame's
2357: `df.attrs['questdb']` claims. A column named there is labelled, and
2358: so is a 16-byte one whose `ArrowDtype` is `pa.uuid()`; any other
2359: extension type is judged by its storage. A pandas frame cannot carry
2360: field metadata."""
2361: cdef object name
2362: cdef object dtype
2363: cdef object arrowtype
2364: cdef object ext_name
2365: cdef object entry
+2366: cdef set labelled = set()
__pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_labelled = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+2367: if dtypes is None or not _is_pandas_dataframe_object(df):
__pyx_t_3 = (__pyx_v_dtypes == Py_None);
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = __pyx_f_7questdb_7_client__is_pandas_dataframe_object(__pyx_v_df); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 2367, __pyx_L1_error)
__pyx_t_4 = (!__pyx_t_3);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* … */
}
+2368: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2369: if not _dataframe_try_import_pyarrow():
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_try_import_pyarrow(); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 2369, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_2); if (__pyx_t_4) { /* … */ }
2370: # No pyarrow means no `ArrowDtype` column to check.
+2371: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2372: if overrides is not None:
__pyx_t_4 = (__pyx_v_overrides != Py_None);
if (__pyx_t_4) {
/* … */
}
+2373: for entry in overrides:
if (likely(PyList_CheckExact(__pyx_v_overrides)) || PyTuple_CheckExact(__pyx_v_overrides)) { __pyx_t_1 = __pyx_v_overrides; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_overrides); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2373, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { 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(2, 2373, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } 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(2, 2373, __pyx_L1_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_1, __pyx_t_5)); #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); #endif ++__pyx_t_5; } if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2373, __pyx_L1_error) } else { __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 2373, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_7); __pyx_t_7 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2374: labelled.add(entry[0])
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySet_Add(__pyx_v_labelled, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 2374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+2375: for name, dtype in dtypes.items():
__pyx_t_5 = 0;
if (unlikely(__pyx_v_dtypes == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 2375, __pyx_L1_error)
}
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_dtypes, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_1);
__pyx_t_1 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_5, &__pyx_t_7, &__pyx_t_11, NULL, __pyx_t_10);
if (unlikely(__pyx_t_12 == 0)) break;
if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(2, 2375, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_11);
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_11);
__pyx_t_11 = 0;
+2376: arrowtype = getattr(dtype, 'pyarrow_dtype', None)
__pyx_t_11 = __Pyx_GetAttr3(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_XDECREF_SET(__pyx_v_arrowtype, __pyx_t_11); __pyx_t_11 = 0;
+2377: if arrowtype is None:
__pyx_t_4 = (__pyx_v_arrowtype == Py_None);
if (__pyx_t_4) {
/* … */
}
+2378: continue
goto __pyx_L11_continue;
+2379: ext_name = None
__Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ext_name, Py_None);
+2380: if isinstance(arrowtype, _PYARROW.lib.BaseExtensionType):
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_BaseExtensionType); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_4 = PyObject_IsInstance(__pyx_v_arrowtype, __pyx_t_7); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 2380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* … */ }
+2381: ext_name = arrowtype.extension_name
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_extension_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_ext_name, __pyx_t_7); __pyx_t_7 = 0;
+2382: arrowtype = arrowtype.storage_type
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_storage_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_arrowtype, __pyx_t_7); __pyx_t_7 = 0;
+2383: if (arrowtype.id != _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_CompareBoolNe_object_object(__pyx_t_7, __pyx_t_13, Py_NE); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } /* … */ if (__pyx_t_4) { /* … */ }
+2384: or arrowtype.byte_width not in (16, 32)
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2384, __pyx_L1_error) if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L19_bool_binop_done; } __pyx_t_3 = (__Pyx_PyLong_BoolNeObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_32, 32, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2384, __pyx_L1_error) __pyx_t_2 = __pyx_t_3; __pyx_L19_bool_binop_done:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_3 = __pyx_t_2; if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L16_bool_binop_done; }
+2385: or (arrowtype.byte_width == 16
__pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_3 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (!__pyx_t_3) { goto __pyx_L21_next_or; } else { }
+2386: and ext_name == _ARROW_EXT_UUID)
__pyx_t_3 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_ext_name, __pyx_v_7questdb_7_client__ARROW_EXT_UUID, Py_EQ); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2386, __pyx_L1_error) if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L16_bool_binop_done; } __pyx_L21_next_or:;
+2387: or _arrow_export_name(name).encode('utf-8') in labelled):
__pyx_t_11 = __pyx_f_7questdb_7_client__arrow_export_name(__pyx_v_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = __pyx_t_11; __Pyx_INCREF(__pyx_t_7); __pyx_t_14 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_utf_8}; __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_t_13, __pyx_v_labelled, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L16_bool_binop_done:;
+2388: continue
goto __pyx_L11_continue;
+2389: raise QuestDBError(
__pyx_t_11 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+2390: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+2391: _unlabelled_fsb16_message(name)
__pyx_t_17 = __pyx_f_7questdb_7_client__unlabelled_fsb16_message(__pyx_v_name); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_15 = __pyx_t_17; __pyx_t_17 = 0; } else {
+2392: if arrowtype.byte_width == 16
__pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 2392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_4 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_17, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; if (__pyx_t_4) {
+2393: else _unlabelled_fsb32_message(name))
__pyx_t_17 = __pyx_f_7questdb_7_client__unlabelled_fsb32_message(__pyx_v_name); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __pyx_t_15 = __pyx_t_17; __pyx_t_17 = 0; } __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_14 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_16, __pyx_t_15}; __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 2389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_Raise(__pyx_t_13, 0, 0, 0); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(2, 2389, __pyx_L1_error) __pyx_L11_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2394: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2395:
2396:
+2397: cdef const char* _ARROW_FMT_INT8 = "c"
__pyx_v_7questdb_7_client__ARROW_FMT_INT8 = __pyx_k_c;
+2398: cdef const char* _ARROW_FMT_INT16 = "s"
__pyx_v_7questdb_7_client__ARROW_FMT_INT16 = __pyx_k_s;
+2399: cdef const char* _ARROW_FMT_INT32 = "i"
__pyx_v_7questdb_7_client__ARROW_FMT_INT32 = __pyx_k_i;
+2400: cdef const char* _ARROW_FMT_UTF8_STRING = 'u'
__pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING = __pyx_k_u_2;
+2401: cdef const char* _ARROW_FMT_LRG_UTF8_STRING = 'U'
__pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING = __pyx_k_U;
2402:
2403:
+2404: cdef void_int _dataframe_category_series_as_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_category_series_as_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
char const *__pyx_v_format;
PyObject *__pyx_v_chunks = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("questdb._client._dataframe_category_series_as_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_chunks);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2405: PandasCol pandas_col, col_t* col) except -1:
2406: cdef const char* format
+2407: cdef list chunks = _dataframe_series_to_arrow_chunks(pandas_col)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_series_to_arrow_chunks(__pyx_v_pandas_col); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_chunks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
2408:
+2409: _dataframe_export_arrow_chunks(chunks, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_export_arrow_chunks(__pyx_v_chunks, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2409, __pyx_L1_error)
2410:
+2411: format = col.setup.arrow_schema.format
__pyx_t_3 = __pyx_v_col->setup->arrow_schema.format; __pyx_v_format = __pyx_t_3;
+2412: if strncmp(format, _ARROW_FMT_INT8, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT8, 1) == 0);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+2413: col.setup.source = col_source_t.col_source_str_i8_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i8_cat;
+2414: elif strncmp(format, _ARROW_FMT_INT16, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT16, 1) == 0);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+2415: col.setup.source = col_source_t.col_source_str_i16_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i16_cat;
+2416: elif strncmp(format, _ARROW_FMT_INT32, 1) == 0:
__pyx_t_4 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_INT32, 1) == 0);
if (likely(__pyx_t_4)) {
/* … */
goto __pyx_L3;
}
+2417: col.setup.source = col_source_t.col_source_str_i32_cat
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_i32_cat;
2418: else:
+2419: raise QuestDBError(
/*else*/ {
__pyx_t_5 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
+2420: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+2421: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* … */ __pyx_t_12 = 57; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]); #endif __pyx_t_13 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 |= __Pyx_PyUnicode_KIND_04(__pyx_t_11[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_11[3]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = 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_14 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_8, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__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_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2419, __pyx_L1_error) } __pyx_L3:;
2422: 'Unsupported arrow category index type. ' +
+2423: f'Got {(<bytes>format).decode("utf-8")!r}.')
__pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__pyx_t_9 == Py_None)) { PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "decode"); __PYX_ERR(2, 2423, __pyx_L1_error) } __pyx_t_10 = __Pyx_decode_bytes(((PyObject*)__pyx_t_9), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_10), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_11[1] = __pyx_t_7; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_arrow_category_inde; __pyx_t_11[3] = __pyx_t_9; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
2424:
+2425: format = col.setup.arrow_schema.dictionary.format
__pyx_t_3 = __pyx_v_col->setup->arrow_schema.dictionary->format; __pyx_v_format = __pyx_t_3;
+2426: if (strncmp(format, _ARROW_FMT_UTF8_STRING, 1) != 0 and
__pyx_t_15 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING, 1) != 0);
if (__pyx_t_15) {
} else {
__pyx_t_4 = __pyx_t_15;
goto __pyx_L5_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_4)) {
/* … */
}
+2427: strncmp(format, _ARROW_FMT_LRG_UTF8_STRING, 1) != 0):
__pyx_t_15 = (strncmp(__pyx_v_format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) != 0); __pyx_t_4 = __pyx_t_15; __pyx_L5_bool_binop_done:;
+2428: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
+2429: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2430: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* … */ __pyx_t_12 = 64; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]); #endif __pyx_t_13 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 |= __Pyx_PyUnicode_KIND_04(__pyx_t_11[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_11[3]); #endif __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_6); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_14 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2428, __pyx_L1_error)
2431: 'Expected a category of strings, ' +
+2432: f'got a category of {pandas_col.series.dtype.categories.dtype}.')
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pandas_col->series, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_categories); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_11[1] = __pyx_t_8; __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_Expected_a_category_of_strings; __pyx_t_11[3] = __pyx_t_7; __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
2433:
+2434: cdef void_int _dataframe_series_resolve_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_resolve_arrow(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, PyObject *__pyx_v_arrowtype, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, int __pyx_v_qwp_planner) {
int __pyx_v_is_decimal_col;
PyObject *__pyx_v_ext_name = 0;
PyObject *__pyx_v_t_dec32 = 0;
PyObject *__pyx_v_t_dec64 = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
__Pyx_INCREF(__pyx_v_arrowtype);
/* … */
/* 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_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_series_resolve_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ext_name);
__Pyx_XDECREF(__pyx_v_t_dec32);
__Pyx_XDECREF(__pyx_v_t_dec64);
__Pyx_XDECREF(__pyx_v_arrowtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2435: PandasCol pandas_col,
2436: object arrowtype,
2437: col_t *col,
2438: bint qwp_planner) except -1:
+2439: cdef bint is_decimal_col = False
__pyx_v_is_decimal_col = 0;
+2440: _dataframe_require_pyarrow()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_require_pyarrow(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2441: if arrowtype.id == _PYARROW.lib.Type_STRING:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_STRING); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_1, __pyx_t_3, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2441, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ }
+2442: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2442, __pyx_L1_error)
+2443: col.setup.source = col_source_t.col_source_str_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_utf8_arrow;
+2444: col.scale = 0
__pyx_v_col->scale = 0;
+2445: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2446: elif arrowtype.id == _PYARROW.lib.Type_LARGE_STRING:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Type_LARGE_STRING); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2446, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* … */ }
+2447: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2447, __pyx_L1_error)
+2448: col.setup.source = col_source_t.col_source_str_lrg_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow;
+2449: col.scale = 0
__pyx_v_col->scale = 0;
+2450: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2451:
2452: # Unwrap pyarrow extension types (e.g. `arrow.uuid` wrapping
2453: # `FixedSizeBinary(16)`) to their storage type so dispatch picks the
2454: # storage-shape source, but keep the extension name: it is what makes
2455: # a 16-byte column a UUID rather than opaque BINARY.
2456: # pyarrow exposes no `Type_EXTENSION` constant in all versions we
2457: # support; check via `BaseExtensionType` instead.
2458: #
2459: # The name is legible here only where pyarrow built an extension
2460: # *type*. `arrow.uuid` is a canonical extension registered from
2461: # pyarrow 18 on, and a column carries the type when it comes from
2462: # `pa.uuid()` or is imported over the C data interface or IPC, both
2463: # of which rebuild it from the field's `ARROW:extension:name` key.
2464: # That key written as plain field metadata — `pa.Table.from_arrays`
2465: # over a hand-built schema, say — stays on the field, and a pandas
2466: # `ArrowDtype` holds a type and no field, so it never reaches this
2467: # planner. Building the column from `pa.uuid()` is the one spelling
2468: # readable from both sides.
+2469: cdef object ext_name = None
__Pyx_INCREF(Py_None);
__pyx_v_ext_name = Py_None;
+2470: if isinstance(arrowtype, _PYARROW.lib.BaseExtensionType):
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BaseExtensionType); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyObject_IsInstance(__pyx_v_arrowtype, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 2470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ }
+2471: ext_name = arrowtype.extension_name
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_extension_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ext_name, __pyx_t_3); __pyx_t_3 = 0;
+2472: arrowtype = arrowtype.storage_type
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_storage_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_arrowtype, __pyx_t_3); __pyx_t_3 = 0;
2473:
2474: # A round-trip claim is a label: `uuid` on a 16-byte column or
2475: # `long256` on a 32-byte one makes it `col_source_fsb_claimed_arrow`,
2476: # whose value buffer is already the wire layout. An `arrow.uuid`
2477: # column keeps its own source below, which states UUID to the
2478: # native importer.
+2479: if (qwp_planner
if (__pyx_v_qwp_planner) {
} else {
__pyx_t_4 = __pyx_v_qwp_planner;
goto __pyx_L6_bool_binop_done;
}
/* … */
if (__pyx_t_4) {
/* … */
}
+2480: and arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_3, __pyx_t_1, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; }
+2481: and ext_name != _ARROW_EXT_UUID
__pyx_t_6 = __Pyx_PyObject_CompareBoolNe_object_str(__pyx_v_ext_name, __pyx_v_7questdb_7_client__ARROW_EXT_UUID, Py_NE); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2481, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; }
+2482: and ((arrowtype.byte_width == 16
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_6) { goto __pyx_L10_next_or; } else { }
+2483: and pandas_col.claim_kind == 'uuid')
__pyx_t_6 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_pandas_col->claim_kind, __pyx_mstate_global->__pyx_n_u_uuid, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2483, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_L10_next_or:;
+2484: or (arrowtype.byte_width == 32
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_32, 32, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L6_bool_binop_done; }
+2485: and pandas_col.claim_kind == 'long256'))):
__pyx_t_6 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_pandas_col->claim_kind, __pyx_mstate_global->__pyx_n_u_long256, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2485, __pyx_L1_error) __pyx_t_4 = __pyx_t_6; __pyx_L6_bool_binop_done:;
+2486: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2486, __pyx_L1_error)
+2487: col.setup.source = col_source_t.col_source_fsb_claimed_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_fsb_claimed_arrow;
+2488: col.scale = 0
__pyx_v_col->scale = 0;
+2489: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2490:
2491: # An unlabelled 16- or 32-byte column is refused: this planner only
2492: # ever sees pandas frames, and a pandas frame may have dropped the
2493: # label on the way in. `_ARROW_FMT_FSB16` explains the rule, which
2494: # the Arrow capsule path applies to pandas frames too
2495: # (`_refuse_unlabelled_fsb_pandas_columns`), with the same messages.
2496: #
2497: # The check does not consult the pyarrow version. `pa.uuid()` exists
2498: # from pyarrow 18 on, so the message notes that version when it is
2499: # missing, but which columns are accepted must not vary: an optional
2500: # dependency's version deciding whether a write errors or lands as
2501: # the wrong type is a worse trap than either outcome on its own.
2502: #
2503: # Row-ILP takes neither branch. It has no LONG256 and no BINARY at
2504: # all, so every remedy below is a dead end there; the column falls
2505: # through to the resolver's own "could not map to any ILP type".
+2506: if (qwp_planner
if (__pyx_v_qwp_planner) {
} else {
__pyx_t_4 = __pyx_v_qwp_planner;
goto __pyx_L14_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_4)) {
/* … */
}
+2507: and arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L14_bool_binop_done; }
+2508: and arrowtype.byte_width == 32):
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_32, 32, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L14_bool_binop_done:;
+2509: raise QuestDBError(
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+2510: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+2511: _unlabelled_fsb32_message(pandas_col.name))
__pyx_t_7 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_9 = __pyx_f_7questdb_7_client__unlabelled_fsb32_message(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2511, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_10 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_1);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_10 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_8, __pyx_t_9};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 2509, __pyx_L1_error)
2512:
+2513: if (qwp_planner
if (__pyx_v_qwp_planner) {
} else {
__pyx_t_4 = __pyx_v_qwp_planner;
goto __pyx_L18_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_4)) {
/* … */
}
+2514: and arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_2, __pyx_t_9, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L18_bool_binop_done; }
+2515: and arrowtype.byte_width == 16
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2515, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L18_bool_binop_done; }
+2516: and ext_name != _ARROW_EXT_UUID):
__pyx_t_6 = __Pyx_PyObject_CompareBoolNe_object_str(__pyx_v_ext_name, __pyx_v_7questdb_7_client__ARROW_EXT_UUID, Py_NE); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2516, __pyx_L1_error) __pyx_t_4 = __pyx_t_6; __pyx_L18_bool_binop_done:;
+2517: raise QuestDBError(
__pyx_t_2 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+2518: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2519: _unlabelled_fsb16_message(pandas_col.name))
__pyx_t_8 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_8);
__pyx_t_7 = __pyx_f_7questdb_7_client__unlabelled_fsb16_message(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = 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_10 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_7};
__pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2517, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(2, 2517, __pyx_L1_error)
2520:
2521: # Eight bytes is the shape of a polars `Object` column's handles (see
2522: # `_ARROW_FMT_FSB8`), refused whatever its label. The two widths above
2523: # raise `BadDataFrame`; this one raises `ArrowUnsupportedColumnKind`,
2524: # the code 5.0 raises for this width, so callers written against 5.0
2525: # see the same code. Without this check the column would reach the
2526: # native writer through `col_source_arrow_passthrough` and land as
2527: # BINARY.
+2528: if (qwp_planner
if (__pyx_v_qwp_planner) {
} else {
__pyx_t_4 = __pyx_v_qwp_planner;
goto __pyx_L23_bool_binop_done;
}
/* … */
if (unlikely(__pyx_t_4)) {
/* … */
}
+2529: and arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_9, __pyx_t_7, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L23_bool_binop_done; }
+2530: and arrowtype.byte_width == 8):
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_8, 8, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2530, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L23_bool_binop_done:;
+2531: raise QuestDBError(
__pyx_t_9 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+2532: QuestDBErrorCode.ArrowUnsupportedColumnKind,
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ArrowUnsupportedColumnKind); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2533: _fsb8_refusal_message(pandas_col.name))
__pyx_t_1 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_8 = __pyx_f_7questdb_7_client__fsb8_refusal_message(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
assert(__pyx_t_9);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
__pyx_t_10 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_2, __pyx_t_8};
__pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2531, __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(2, 2531, __pyx_L1_error)
2534:
+2535: cdef object t_dec32 = getattr(_PYARROW.lib, 'Type_DECIMAL32', None)
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_GetAttr3(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL32, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_t_dec32 = __pyx_t_3; __pyx_t_3 = 0;
+2536: cdef object t_dec64 = getattr(_PYARROW.lib, 'Type_DECIMAL64', None)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_GetAttr3(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL64, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_t_dec64 = __pyx_t_7; __pyx_t_7 = 0;
+2537: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2537, __pyx_L1_error)
+2538: if t_dec32 is not None and arrowtype.id == t_dec32:
__pyx_t_6 = (__pyx_v_t_dec32 != Py_None);
if (__pyx_t_6) {
} else {
__pyx_t_4 = __pyx_t_6;
goto __pyx_L27_bool_binop_done;
}
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_v_t_dec32, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2538, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_4 = __pyx_t_6;
__pyx_L27_bool_binop_done:;
if (__pyx_t_4) {
/* … */
goto __pyx_L26;
}
+2539: col.setup.source = col_source_t.col_source_decimal32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal32_arrow;
+2540: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+2541: elif t_dec64 is not None and arrowtype.id == t_dec64:
__pyx_t_6 = (__pyx_v_t_dec64 != Py_None);
if (__pyx_t_6) {
} else {
__pyx_t_4 = __pyx_t_6;
goto __pyx_L29_bool_binop_done;
}
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_v_t_dec64, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2541, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_4 = __pyx_t_6;
__pyx_L29_bool_binop_done:;
if (__pyx_t_4) {
/* … */
goto __pyx_L26;
}
+2542: col.setup.source = col_source_t.col_source_decimal64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal64_arrow;
+2543: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+2544: elif arrowtype.id == _PYARROW.lib.Type_DECIMAL128:
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL128); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_t_8, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2545: col.setup.source = col_source_t.col_source_decimal128_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal128_arrow;
+2546: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+2547: elif arrowtype.id == _PYARROW.lib.Type_DECIMAL256:
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type_DECIMAL256); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_8, __pyx_t_3, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2548: col.setup.source = col_source_t.col_source_decimal256_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal256_arrow;
+2549: is_decimal_col = True
__pyx_v_is_decimal_col = 1;
+2550: elif arrowtype.id == _PYARROW.lib.Type_BOOL:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Type_BOOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_3, __pyx_t_7, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2551: col.setup.source = col_source_t.col_source_bool_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_arrow;
+2552: elif arrowtype.id == _PYARROW.lib.Type_FLOAT:
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FLOAT); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_t_8, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2553: col.setup.source = col_source_t.col_source_f32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_arrow;
+2554: elif arrowtype.id == _PYARROW.lib.Type_DOUBLE:
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_8, __pyx_t_3, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2555: col.setup.source = col_source_t.col_source_f64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_arrow;
+2556: elif arrowtype.id == _PYARROW.lib.Type_INT8:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Type_INT8); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_3, __pyx_t_7, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2557: col.setup.source = col_source_t.col_source_i8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_arrow;
+2558: elif arrowtype.id == _PYARROW.lib.Type_INT16:
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_INT16); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_t_8, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2559: col.setup.source = col_source_t.col_source_i16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_arrow;
+2560: elif arrowtype.id == _PYARROW.lib.Type_INT32:
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type_INT32); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_8, __pyx_t_3, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2561: col.setup.source = col_source_t.col_source_i32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_arrow;
+2562: elif arrowtype.id == _PYARROW.lib.Type_INT64:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Type_INT64); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_3, __pyx_t_7, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2563: col.setup.source = col_source_t.col_source_i64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_arrow;
+2564: elif (arrowtype.id == _PYARROW.lib.Type_FIXED_SIZE_BINARY
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Type_FIXED_SIZE_BINARY); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_7, __pyx_t_8, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L31_bool_binop_done; } /* … */ if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2565: and arrowtype.byte_width == 16
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_byte_width); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_8, __pyx_mstate_global->__pyx_int_16, 16, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L31_bool_binop_done; }
+2566: and ext_name == _ARROW_EXT_UUID):
__pyx_t_6 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_ext_name, __pyx_v_7questdb_7_client__ARROW_EXT_UUID, Py_EQ); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2566, __pyx_L1_error) __pyx_t_4 = __pyx_t_6; __pyx_L31_bool_binop_done:;
+2567: col.setup.source = col_source_t.col_source_fsb16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_fsb16_arrow;
+2568: elif arrowtype.id == _PYARROW.lib.Type_UINT32:
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PYARROW, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type_UINT32); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_8, __pyx_t_3, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L26; }
+2569: col.setup.source = col_source_t.col_source_u32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_arrow;
2570: else:
+2571: col.setup.source = col_source_t.col_source_arrow_passthrough
/*else*/ {
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_arrow_passthrough;
+2572: col.scale = 0
__pyx_v_col->scale = 0;
+2573: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
}
__pyx_L26:;
+2574: if is_decimal_col:
if (__pyx_v_is_decimal_col) {
/* … */
goto __pyx_L34;
}
+2575: if arrowtype.scale < 0 or arrowtype.scale > 76:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_CompareBoolLt_object_int(__pyx_t_3, __pyx_mstate_global->__pyx_int_0, Py_LT); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { __pyx_t_4 = __pyx_t_6; goto __pyx_L36_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_t_3, __pyx_mstate_global->__pyx_int_76, Py_GT); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(2, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_6; __pyx_L36_bool_binop_done:; if (unlikely(__pyx_t_4)) { /* … */ }
+2576: raise QuestDBError(
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+2577: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+2578: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* … */ __pyx_t_13 = 80; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[3]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_12[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[3]); #endif __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_10 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); assert(__pyx_t_8); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_10 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_9, __pyx_t_1}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 2576, __pyx_L1_error)
+2579: f'Unsupported decimal scale {arrowtype.scale}: ' +
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_12[1] = __pyx_t_2; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_decimal_scale; __pyx_t_12[3] = __pyx_t_11; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_Must_be_in_the_range_0_to_76_in;
2580: 'Must be in the range 0 to 76 inclusive.')
+2581: col.scale = <uint8_t>arrowtype.scale
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arrowtype, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_15 = __Pyx_PyLong_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_15 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 2581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_col->scale = ((uint8_t)__pyx_t_15);
2582: else:
+2583: col.scale = 0
/*else*/ {
__pyx_v_col->scale = 0;
}
__pyx_L34:;
+2584: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2585:
+2586: cdef inline bint _dataframe_is_float_nan(PyObject* obj) noexcept:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_is_float_nan(PyObject *__pyx_v_obj) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
+2587: return PyFloat_CheckExact(obj) and isnan(PyFloat_AS_DOUBLE(obj))
__pyx_t_2 = PyFloat_CheckExact(__pyx_v_obj); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L3_bool_binop_done; } __pyx_t_2 = isnan(PyFloat_AS_DOUBLE(__pyx_v_obj)); __pyx_t_1 = __pyx_t_2; __pyx_L3_bool_binop_done:; { __pyx_r = __pyx_t_1; } goto __pyx_L0;
2588:
2589:
+2590: cdef inline bint _dataframe_is_null_pyobj(PyObject* obj) noexcept:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(PyObject *__pyx_v_obj) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
2591: return (
+2592: (obj == Py_None) or
__pyx_t_2 = (__pyx_v_obj == Py_None);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2593: (obj == <PyObject*>_PANDAS_NA) or
__pyx_t_2 = (__pyx_v_obj == ((PyObject *)__pyx_v_7questdb_7_client__PANDAS_NA));
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2594: (obj == <PyObject*>_PANDAS_NAT) or
__pyx_t_2 = (__pyx_v_obj == ((PyObject *)__pyx_v_7questdb_7_client__PANDAS_NAT));
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
+2595: _dataframe_is_float_nan(obj))
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_is_float_nan(__pyx_v_obj);
__pyx_t_1 = __pyx_t_2;
__pyx_L3_bool_binop_done:;
{
__pyx_r = __pyx_t_1;
}
goto __pyx_L0;
2596:
2597:
+2598: cdef str _row_wrapper_calls_sentence(str type_name):
static PyObject *__pyx_f_7questdb_7_client__row_wrapper_calls_sentence(PyObject *__pyx_v_type_name) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._row_wrapper_calls_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2599: return (
+2600: f'Storing {type_name} from a DataFrame works only with '
__pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_Storing; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_from_a_DataFrame_works_only_wit; __pyx_t_3 = 222; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_5); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_5 = 0; goto __pyx_L0;
2601: '`QuestDB.dataframe()`, `PooledSender.dataframe()`, and '
2602: '`Sender.dataframe()` over `ws::` or `wss::`, not with '
2603: '`Buffer.dataframe()` or with `Sender.dataframe()` over other '
2604: 'protocols.')
2605:
2606:
+2607: cdef str _row_wrapper_arrow_sentence(object col_name, str kind):
static PyObject *__pyx_f_7questdb_7_client__row_wrapper_arrow_sentence(PyObject *__pyx_v_col_name, PyObject *__pyx_v_kind) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._row_wrapper_arrow_sentence", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2608: return (
+2609: 'make every column Arrow-backed with '
__pyx_t_4 = 120; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[3]); #endif __pyx_t_5 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_3[3]); #endif __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = ((PyObject*)__pyx_t_6); } __Pyx_XDECREF(__pyx_temp); } __pyx_t_6 = 0; goto __pyx_L0;
2610: '`df = df.convert_dtypes(dtype_backend="pyarrow")`, and pass '
+2611: f'`schema_overrides={{{col_name!r}: {kind}}}`.')
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_make_every_column_Arrow_backed_w; __pyx_t_3[1] = __pyx_t_1; __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_3[3] = __pyx_t_2; __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__16;
2612:
2613:
+2614: cdef object _dataframe_row_wrapper_df_message(
static PyObject *__pyx_f_7questdb_7_client__dataframe_row_wrapper_df_message(PyObject *__pyx_v_col_name, PyObject *__pyx_v_obj) {
PyObject *__pyx_v_col = 0;
PyObject *__pyx_v_precision = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._dataframe_row_wrapper_df_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_col);
__Pyx_XDECREF(__pyx_v_precision);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2615: object col_name, object obj):
2616: """A working DataFrame route for a scalar wrapper learned from row()."""
+2617: cdef str col = f'df[{col_name!r}]'
__pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_col_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_df; __pyx_t_2[1] = __pyx_t_1; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__17; __pyx_t_3 = 4; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_col = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0;
2618: cdef object precision
+2619: if isinstance(obj, Char):
__pyx_t_6 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_Char);
if (__pyx_t_6) {
/* … */
}
2620: return (
+2621: '`questdb.Char` values work only with `row()`, not in a '
__pyx_t_3 = 164;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_7[3]);
#endif
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2622: 'DataFrame. To store this column as CHAR, convert it with '
+2623: f'`{col} = {col}.map(lambda v: ord(v.value)).astype(\'uint16\')`, '
__pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_questdb_Char_values_work_only_w;
__pyx_t_7[1] = __pyx_v_col;
__pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__18;
__pyx_t_7[3] = __pyx_v_col;
__pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_map_lambda_v_ord_v_value_astype;
+2624: + _row_wrapper_arrow_sentence(col_name, "'char'") + ' '
__pyx_t_1 = __pyx_f_7questdb_7_client__row_wrapper_arrow_sentence(__pyx_v_col_name, __pyx_mstate_global->__pyx_kp_u_char); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u__19); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2625: + _row_wrapper_calls_sentence('CHAR'))
__pyx_t_8 = __pyx_f_7questdb_7_client__row_wrapper_calls_sentence(__pyx_mstate_global->__pyx_n_u_CHAR); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_5; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_5 = 0; goto __pyx_L0;
+2626: if isinstance(obj, DateMillis):
__pyx_t_6 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_DateMillis);
if (__pyx_t_6) {
/* … */
}
2627: return (
+2628: '`questdb.DateMillis` values work only with `row()`, not in a '
__pyx_t_3 = 312;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_7[3]);
#endif
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
2629: 'DataFrame. To store this column as DATE, convert it with '
+2630: f'`{col} = {col}.map(lambda v: v.value)'
__pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_questdb_DateMillis_values_work;
__pyx_t_7[1] = __pyx_v_col;
__pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__18;
__pyx_t_7[3] = __pyx_v_col;
__pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_map_lambda_v_v_value_astype_pd;
2631: '.astype(pd.ArrowDtype(pa.timestamp(\'ms\')))`. The Arrow type '
2632: 'alone selects DATE, and `date32()` and `date64()` columns work '
2633: 'too; `schema_overrides` has no DATE option. '
+2634: + _row_wrapper_calls_sentence('DATE'))
__pyx_t_8 = __pyx_f_7questdb_7_client__row_wrapper_calls_sentence(__pyx_mstate_global->__pyx_n_u_DATE); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_1; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L0;
+2635: if isinstance(obj, Long256):
__pyx_t_6 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_Long256);
if (__pyx_t_6) {
/* … */
}
2636: return (
+2637: '`questdb.Long256` values work only with `row()`, not in a '
__pyx_t_3 = 208;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_7[3]);
#endif
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2638: 'DataFrame. To store this column as LONG256, convert it with '
+2639: f'`{col} = {col}.map(lambda v: v.value.to_bytes(32, \'little\'))'
__pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_questdb_Long256_values_work_onl;
__pyx_t_7[1] = __pyx_v_col;
__pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__18;
__pyx_t_7[3] = __pyx_v_col;
__pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_map_lambda_v_v_value_to_bytes_3;
2640: '.astype(pd.ArrowDtype(pa.binary(32)))`, '
+2641: + _row_wrapper_arrow_sentence(col_name, "'long256'") + ' '
__pyx_t_8 = __pyx_f_7questdb_7_client__row_wrapper_arrow_sentence(__pyx_v_col_name, __pyx_mstate_global->__pyx_kp_u_long256_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__19); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2642: + _row_wrapper_calls_sentence('LONG256'))
__pyx_t_5 = __pyx_f_7questdb_7_client__row_wrapper_calls_sentence(__pyx_mstate_global->__pyx_n_u_LONG256); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_1; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L0;
+2643: if isinstance(obj, Geohash):
__pyx_t_6 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_Geohash);
if (__pyx_t_6) {
/* … */
}
+2644: precision = obj.precision
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_precision = __pyx_t_1; __pyx_t_1 = 0;
2645: return (
+2646: '`questdb.Geohash` values work only with `row()`, not in a '
__pyx_t_3 = 147;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[3]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_7[3]);
#endif
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
2647: 'DataFrame. To store this column as GEOHASH, convert it with '
+2648: f'`{col} = {col}.map(lambda v: v.bits)`, '
__pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_questdb_Geohash_values_work_onl;
__pyx_t_7[1] = __pyx_v_col;
__pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__18;
__pyx_t_7[3] = __pyx_v_col;
__pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_map_lambda_v_v_bits;
+2649: + _row_wrapper_arrow_sentence(
__pyx_t_5 = __pyx_f_7questdb_7_client__row_wrapper_arrow_sentence(__pyx_v_col_name, ((PyObject*)__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2650: col_name, f"('geohash', {precision})")
__pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_precision, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_geohash; __pyx_t_2[1] = __pyx_t_5; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u__11; __pyx_t_3 = 13; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]); #endif __pyx_t_4 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+2651: + ' Every value in the column must have a precision of '
__pyx_t_3 = 59;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2[1]);
#endif
__pyx_t_4 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_4 |= __Pyx_PyUnicode_KIND_04(__pyx_t_2[1]);
#endif
__pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2652: f'{precision} bits. '
__pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_precision, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2[0] = __pyx_mstate_global->__pyx_kp_u_Every_value_in_the_column_must; __pyx_t_2[1] = __pyx_t_5; __pyx_t_2[2] = __pyx_mstate_global->__pyx_kp_u_bits;
+2653: + _row_wrapper_calls_sentence('GEOHASH'))
__pyx_t_1 = __pyx_f_7questdb_7_client__row_wrapper_calls_sentence(__pyx_mstate_global->__pyx_n_u_GEOHASH); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_8; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_8 = 0; goto __pyx_L0;
+2654: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
2655:
2656: # noinspection PyUnreachableCode
+2657: cdef void_int _dataframe_series_sniff_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_series_sniff_pyobj(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
size_t __pyx_v_el_index;
size_t __pyx_v_n_elements;
PyObject **__pyx_v_obj_arr;
PyObject *__pyx_v_obj;
PyObject *__pyx_v_obj_ref = 0;
PyArrayObject *__pyx_v_arr;
npy_int __pyx_v_arr_type;
PyArray_Descr *__pyx_v_arr_descr = 0;
PyObject *__pyx_v_arr_type_name = 0;
PyObject *__pyx_v_wrapper_message = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_AddTraceback("questdb._client._dataframe_series_sniff_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_obj_ref);
__Pyx_XDECREF((PyObject *)__pyx_v_arr_descr);
__Pyx_XDECREF(__pyx_v_arr_type_name);
__Pyx_XDECREF(__pyx_v_wrapper_message);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2658: PandasCol pandas_col, col_t* col) except -1:
2659: """
2660: Deduct the type of the object column.
2661: Object columns can contain pretty much anything, but they usually don't.
2662: We make an educated guess by finding the first non-null value in the column.
2663: """
2664: # To access elements.
2665: cdef size_t el_index
+2666: cdef size_t n_elements = len(pandas_col.series)
__pyx_t_1 = __pyx_v_pandas_col->series; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 2666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_elements = __pyx_t_2;
2667: cdef PyObject** obj_arr
2668: cdef PyObject* obj
2669: # Owns the cell for as long as `obj` points at it. Code the cell
2670: # runs while it is read, such as a `__class__` lookup inside
2671: # `isinstance` or a property, can replace it in the frame's array
2672: # and so drop the array's reference to it.
2673: cdef object obj_ref
2674:
2675: # To access elements which are themselves arrays.
2676: cdef PyArrayObject* arr
2677: cdef npy_int arr_type
2678: cdef cnp.dtype arr_descr # A cython defn for `PyArray_Descr*`
2679: cdef str arr_type_name
2680: cdef object wrapper_message
2681:
+2682: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_3 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_3 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2682, __pyx_L1_error)
+2683: obj_arr = <PyObject**>(col.setup.pybuf.buf)
__pyx_v_obj_arr = ((PyObject **)__pyx_v_col->setup->pybuf.buf);
+2684: for el_index in range(n_elements):
__pyx_t_4 = __pyx_v_n_elements;
__pyx_t_5 = __pyx_t_4;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_el_index = __pyx_t_6;
+2685: obj_ref = <object>obj_arr[el_index]
__pyx_t_1 = ((PyObject *)(__pyx_v_obj_arr[__pyx_v_el_index]));
__Pyx_INCREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_obj_ref, __pyx_t_1);
__pyx_t_1 = 0;
+2686: obj = <PyObject*>obj_ref
__pyx_v_obj = ((PyObject *)__pyx_v_obj_ref);
+2687: if not _dataframe_is_null_pyobj(obj):
__pyx_t_7 = (!__pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_obj));
if (__pyx_t_7) {
/* … */
}
}
+2688: if PyBool_Check(obj):
__pyx_t_7 = PyBool_Check(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2689: col.setup.source = col_source_t.col_source_bool_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_pyobj;
+2690: elif PyLong_CheckExact(obj):
__pyx_t_7 = PyLong_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2691: col.setup.source = col_source_t.col_source_int_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_int_pyobj;
+2692: elif PyFloat_CheckExact(obj):
__pyx_t_7 = PyFloat_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2693: col.setup.source = col_source_t.col_source_float_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_float_pyobj;
+2694: elif PyUnicode_CheckExact(obj):
__pyx_t_7 = PyUnicode_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2695: col.setup.source = col_source_t.col_source_str_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_pyobj;
+2696: elif PyArray_CheckExact(obj):
__pyx_t_7 = PyArray_CheckExact(__pyx_v_obj);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2697: arr = <PyArrayObject*>obj
__pyx_v_arr = ((PyArrayObject *)__pyx_v_obj);
+2698: arr_type = PyArray_TYPE(arr)
__pyx_v_arr_type = PyArray_TYPE(__pyx_v_arr);
+2699: if arr_type == NPY_DOUBLE:
__pyx_t_7 = (__pyx_v_arr_type == NPY_DOUBLE);
if (__pyx_t_7) {
/* … */
goto __pyx_L7;
}
+2700: col.setup.source = col_source_t.col_source_arr_f64_numpyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_arr_f64_numpyobj;
2701: else:
+2702: arr_type_name = '??unknown??'
/*else*/ {
__Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_unknown_2);
__pyx_v_arr_type_name = __pyx_mstate_global->__pyx_kp_u_unknown_2;
+2703: arr_descr = cnp.PyArray_DescrFromType(arr_type)
__pyx_t_1 = ((PyObject *)PyArray_DescrFromType(__pyx_v_arr_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arr_descr = ((PyArray_Descr *)__pyx_t_1); __pyx_t_1 = 0;
+2704: if arr_descr is not None:
__pyx_t_7 = (((PyObject *)__pyx_v_arr_descr) != Py_None);
if (__pyx_t_7) {
/* … */
}
2705: # numpy 2.x returns str; 1.x returned bytes.
+2706: arr_type_name = arr_descr.name
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr_descr), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2706, __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(2, 2706, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_arr_type_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0;
+2707: if isinstance(arr_type_name, bytes):
__pyx_t_7 = PyBytes_Check(__pyx_v_arr_type_name);
if (__pyx_t_7) {
/* … */
}
+2708: arr_type_name = arr_type_name.decode('ascii')
__pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__decode, __pyx_v_arr_type_name, __pyx_mstate_global->__pyx_n_u_ascii); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2708, __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(2, 2708, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_arr_type_name, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0;
+2709: raise QuestDBError(
__pyx_t_8 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2709, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
+2710: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+2711: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); /* … */ __pyx_t_2 = 96; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13[3]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_13[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_13[3]); #endif __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_13, 5, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_16 = 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_16 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_15}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2709, __pyx_L1_error) } __pyx_L7:;
2712: 'Unsupported object column containing a numpy array ' +
+2713: f'of an unsupported element type {arr_type_name}.')
__pyx_t_12 = __Pyx_PyUnicode_Unicode(__pyx_v_arr_type_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_13[1] = __pyx_t_10; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_object_column_conta; __pyx_t_13[3] = __pyx_t_12; __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u__3;
+2714: elif (PyBytes_Check(<object>obj) or
__pyx_t_17 = PyBytes_Check(((PyObject *)__pyx_v_obj));
if (!__pyx_t_17) {
} else {
__pyx_t_7 = __pyx_t_17;
goto __pyx_L10_bool_binop_done;
}
/* … */
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2715: PyByteArray_Check(<object>obj) or
__pyx_t_17 = PyByteArray_Check(((PyObject *)__pyx_v_obj));
if (!__pyx_t_17) {
} else {
__pyx_t_7 = __pyx_t_17;
goto __pyx_L10_bool_binop_done;
}
+2716: PyMemoryView_Check(<object>obj)):
__pyx_t_17 = PyMemoryView_Check(((PyObject *)__pyx_v_obj));
__pyx_t_7 = __pyx_t_17;
__pyx_L10_bool_binop_done:;
+2717: col.setup.source = col_source_t.col_source_bytes_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bytes_pyobj;
+2718: elif isinstance(<object>obj, _uuid.UUID):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_uuid_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_UUID); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_9); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 2718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+2719: col.setup.source = col_source_t.col_source_uuid_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_uuid_pyobj;
+2720: elif _is_ipv4_address(<object>obj):
__pyx_t_7 = __pyx_f_7questdb_7_client__is_ipv4_address(((PyObject *)__pyx_v_obj)); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 2720, __pyx_L1_error) if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+2721: col.setup.source = col_source_t.col_source_ipv4_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_ipv4_pyobj;
+2722: elif isinstance(<object>obj, datetime.datetime):
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 2722, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* … */ goto __pyx_L6; }
+2723: col.setup.source = col_source_t.col_source_datetime_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_datetime_pyobj;
+2724: elif _is_decimal(<object>obj):
__pyx_t_7 = __pyx_f_7questdb_7_client__is_decimal(((PyObject *)__pyx_v_obj));
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+2725: col.setup.source = col_source_t.col_source_decimal_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_decimal_pyobj;
+2726: elif isinstance(<object>obj, _IPV4_INTERFACE):
__pyx_t_1 = __pyx_v_7questdb_7_client__IPV4_INTERFACE;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_7 = PyObject_IsInstance(((PyObject *)__pyx_v_obj), __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 2726, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_t_7)) {
/* … */
}
+2727: raise QuestDBError(
__pyx_t_9 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2727, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
+2728: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+2729: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_18[1] = __pyx_t_11; __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_2 = 13; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18[1]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_18[1]); #endif __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_18, 3, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* … */ __pyx_t_11 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15); assert(__pyx_t_9); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); __pyx_t_16 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_11}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2727, __pyx_L1_error)
+2730: _ipv4_interface_df_message(pandas_col.name))
__pyx_t_11 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_11);
__pyx_t_10 = __pyx_f_7questdb_7_client__ipv4_interface_df_message(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
2731: else:
+2732: wrapper_message = _dataframe_row_wrapper_df_message(
/*else*/ {
/* … */
__pyx_t_15 = __pyx_f_7questdb_7_client__dataframe_row_wrapper_df_message(__pyx_t_1, __pyx_v_obj_ref); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2732, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_wrapper_message = __pyx_t_15;
__pyx_t_15 = 0;
+2733: pandas_col.name, obj_ref)
__pyx_t_1 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_1);
+2734: if wrapper_message is not None:
__pyx_t_7 = (__pyx_v_wrapper_message != Py_None);
if (unlikely(__pyx_t_7)) {
/* … */
}
+2735: raise QuestDBError(
__pyx_t_1 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2735, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+2736: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2737: f'Bad column {pandas_col.name!r}: ' + wrapper_message)
__pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_18[1] = __pyx_t_8; __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u__2; __pyx_t_2 = 13; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18[1]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_18[1]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_18, 3, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_v_wrapper_message); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_16 = 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_16 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_9, __pyx_t_8}; __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } __Pyx_Raise(__pyx_t_15, 0, 0, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __PYX_ERR(2, 2735, __pyx_L1_error)
+2738: raise QuestDBError(
__pyx_t_11 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2738, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
+2739: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+2740: f'Bad column {pandas_col.name!r}: ' +
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_Bad_column; __pyx_t_18[1] = __pyx_t_9; __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u_Unsupported_object_column_conta_2; __pyx_t_2 = 68; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_18[1]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_18[1]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_18, 3, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+2741: f'Unsupported object column containing an object of type ' +
__pyx_t_12 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 2741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+2742: _fqn(type(<object>obj)) + '.')
__pyx_t_9 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_obj))))); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); /* … */ __pyx_t_9 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_12, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_16 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_16 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_9}; __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); } __Pyx_Raise(__pyx_t_15, 0, 0, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __PYX_ERR(2, 2738, __pyx_L1_error) } __pyx_L6:;
+2743: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
2744:
2745: # We haven't returned yet, so we've hit an object column that
2746: # exclusively has null values. We will just skip this column.
+2747: col.setup.source = col_source_t.col_source_nulls
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_nulls;
2748:
2749:
+2750: cdef void_int _dataframe_resolve_source_and_buffers(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_source_and_buffers(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, int __pyx_v_qwp_planner) {
PyObject *__pyx_v_dtype = 0;
int __pyx_v_ts_col_source;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_source_and_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2751: PandasCol pandas_col, col_t* col, bint qwp_planner) except -1:
+2752: cdef object dtype = pandas_col.dtype
__pyx_t_1 = __pyx_v_pandas_col->dtype;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_dtype = __pyx_t_1;
__pyx_t_1 = 0;
+2753: cdef int ts_col_source = _dataframe_classify_timestamp_dtype(dtype)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_classify_timestamp_dtype(__pyx_v_dtype); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 2753, __pyx_L1_error)
__pyx_v_ts_col_source = __pyx_t_2;
+2754: if ts_col_source != 0:
__pyx_t_3 = (__pyx_v_ts_col_source != 0);
if (__pyx_t_3) {
/* … */
goto __pyx_L3;
}
+2755: col.setup.source = <col_source_t>ts_col_source
__pyx_v_col->setup->source = ((enum __pyx_t_7questdb_7_client_col_source_t)__pyx_v_ts_col_source);
+2756: if col.setup.source == col_source_t.col_source_dt64ns_numpy:
switch (__pyx_v_col->setup->source) {
case __pyx_e_7questdb_7_client_col_source_dt64ns_numpy:
/* … */
break;
case __pyx_e_7questdb_7_client_col_source_dt64us_numpy:
+2757: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2757, __pyx_L1_error)
+2758: elif col.setup.source == col_source_t.col_source_dt64us_numpy:
break;
default:
2759: # NumPy-backed datetimes are serialized from the raw array buffer.
2760: # This source type covers both native datetime64[us] columns and
2761: # coarser numpy datetime64 units that we normalize to microseconds.
+2762: _dataframe_series_as_pybuf(
__pyx_t_5.__pyx_n = 1;
__pyx_t_5.fallback_dtype = __pyx_mstate_global->__pyx_kp_u_datetime64_us;
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, &__pyx_t_5); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2762, __pyx_L1_error)
2763: pandas_col, col, 'datetime64[us]')
2764: else:
+2765: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2765, __pyx_L1_error)
break;
}
+2766: elif isinstance(dtype, _NUMPY_BOOL):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_BOOL; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2767: col.setup.source = col_source_t.col_source_bool_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_numpy;
+2768: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2768, __pyx_L1_error)
+2769: elif isinstance(dtype, _PANDAS.BooleanDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_BooleanDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2770: col.setup.source = col_source_t.col_source_bool_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_bool_arrow;
+2771: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2771, __pyx_L1_error)
+2772: elif isinstance(dtype, _NUMPY_UINT8):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2773: col.setup.source = col_source_t.col_source_u8_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u8_numpy;
+2774: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2774, __pyx_L1_error)
+2775: elif isinstance(dtype, _NUMPY_INT8):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT8; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2776: col.setup.source = col_source_t.col_source_i8_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_numpy;
+2777: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2777, __pyx_L1_error)
+2778: elif isinstance(dtype, _NUMPY_UINT16):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT16; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2779: col.setup.source = col_source_t.col_source_u16_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u16_numpy;
+2780: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2780, __pyx_L1_error)
+2781: elif isinstance(dtype, _NUMPY_INT16):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT16; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2782: col.setup.source = col_source_t.col_source_i16_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_numpy;
+2783: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2783, __pyx_L1_error)
+2784: elif isinstance(dtype, _NUMPY_UINT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2785: col.setup.source = col_source_t.col_source_u32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_numpy;
+2786: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2786, __pyx_L1_error)
+2787: elif isinstance(dtype, _NUMPY_INT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2788: col.setup.source = col_source_t.col_source_i32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_numpy;
+2789: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2789, __pyx_L1_error)
+2790: elif isinstance(dtype, _NUMPY_UINT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_UINT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2791: col.setup.source = col_source_t.col_source_u64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u64_numpy;
+2792: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2792, __pyx_L1_error)
+2793: elif isinstance(dtype, _NUMPY_INT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_INT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2794: col.setup.source = col_source_t.col_source_i64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_numpy;
+2795: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2795, __pyx_L1_error)
+2796: elif isinstance(dtype, _PANDAS.UInt8Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt8Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2797: col.setup.source = col_source_t.col_source_u8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u8_arrow;
+2798: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2798, __pyx_L1_error)
+2799: elif isinstance(dtype, _PANDAS.Int8Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int8Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2800: col.setup.source = col_source_t.col_source_i8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i8_arrow;
+2801: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2801, __pyx_L1_error)
+2802: elif isinstance(dtype, _PANDAS.UInt16Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt16Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2803: col.setup.source = col_source_t.col_source_u16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u16_arrow;
+2804: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2804, __pyx_L1_error)
+2805: elif isinstance(dtype, _PANDAS.Int16Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int16Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2806: col.setup.source = col_source_t.col_source_i16_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i16_arrow;
+2807: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2807, __pyx_L1_error)
+2808: elif isinstance(dtype, _PANDAS.UInt32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2808, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2809: col.setup.source = col_source_t.col_source_u32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u32_arrow;
+2810: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2810, __pyx_L1_error)
+2811: elif isinstance(dtype, _PANDAS.Int32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2812: col.setup.source = col_source_t.col_source_i32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i32_arrow;
+2813: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2813, __pyx_L1_error)
+2814: elif isinstance(dtype, _PANDAS.UInt64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_UInt64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2815: col.setup.source = col_source_t.col_source_u64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_u64_arrow;
+2816: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2816, __pyx_L1_error)
+2817: elif isinstance(dtype, _PANDAS.Int64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Int64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2818: col.setup.source = col_source_t.col_source_i64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_i64_arrow;
+2819: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2819, __pyx_L1_error)
+2820: elif isinstance(dtype, _NUMPY_FLOAT32):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_FLOAT32; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2821: col.setup.source = col_source_t.col_source_f32_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_numpy;
+2822: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2822, __pyx_L1_error)
+2823: elif isinstance(dtype, _NUMPY_FLOAT64):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_FLOAT64; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2823, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2824: col.setup.source = col_source_t.col_source_f64_numpy
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_numpy;
+2825: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2825, __pyx_L1_error)
+2826: elif isinstance(dtype, _PANDAS.Float32Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Float32Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2827: col.setup.source = col_source_t.col_source_f32_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f32_arrow;
+2828: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2828, __pyx_L1_error)
+2829: elif isinstance(dtype, _PANDAS.Float64Dtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_Float64Dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2830: col.setup.source = col_source_t.col_source_f64_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_f64_arrow;
+2831: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2831, __pyx_L1_error)
+2832: elif isinstance(dtype, _PANDAS.StringDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_StringDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2833: if dtype.storage == 'pyarrow':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pyarrow, Py_EQ); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L4; }
+2834: _dataframe_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2834, __pyx_L1_error)
+2835: if strncmp(col.setup.arrow_schema.format, _ARROW_FMT_UTF8_STRING, 1) == 0:
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.format, __pyx_v_7questdb_7_client__ARROW_FMT_UTF8_STRING, 1) == 0);
if (__pyx_t_3) {
/* … */
goto __pyx_L5;
}
+2836: col.setup.source = col_source_t.col_source_str_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_utf8_arrow;
+2837: elif strncmp(col.setup.arrow_schema.format, _ARROW_FMT_LRG_UTF8_STRING, 1) == 0:
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) == 0);
if (likely(__pyx_t_3)) {
/* … */
goto __pyx_L5;
}
+2838: col.setup.source = col_source_t.col_source_str_lrg_utf8_arrow
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_lrg_utf8_arrow;
2839: else:
+2840: raise QuestDBError(
/*else*/ {
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2840, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+2841: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2842: f'Unknown string dtype storage: {dtype.storage} ' +
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* … */ __pyx_t_13 = 72; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[5]); #endif __pyx_t_2 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 |= __Pyx_PyUnicode_KIND_04(__pyx_t_12[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[5]); #endif __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, __pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+2843: f'for column {pandas_col.name} of dtype {dtype}. ' +
__pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_v_pandas_col->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_string_dtype_storage; __pyx_t_12[1] = __pyx_t_10; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_12[3] = __pyx_t_8; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_of_dtype; __pyx_t_12[5] = __pyx_t_11; __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_Format_specifier;
+2844: f'Format specifier: ' + repr(bytes(col.setup.arrow_schema.format).decode('latin-1')))
__pyx_t_8 = NULL;
__pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_col->setup->arrow_schema.format); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_15 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_10};
__pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
}
__pyx_t_10 = __Pyx_decode_bytes(__pyx_t_11, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = PyObject_Repr(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_14, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_15 = 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_15 = 0;
}
#endif
{
PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_9, __pyx_t_10};
__pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2840, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(2, 2840, __pyx_L1_error)
}
__pyx_L5:;
+2845: elif dtype.storage == 'python':
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_python, Py_EQ); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 2845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { /* … */ goto __pyx_L4; }
+2846: col.setup.source = col_source_t.col_source_str_pyobj
__pyx_v_col->setup->source = __pyx_e_7questdb_7_client_col_source_str_pyobj;
+2847: _dataframe_series_as_pybuf(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_as_pybuf(__pyx_v_pandas_col, __pyx_v_col, NULL); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2847, __pyx_L1_error)
2848: else:
+2849: raise QuestDBError(
/*else*/ {
__pyx_t_7 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
+2850: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+2851: f'Unknown string dtype storage: f{dtype.storage} ' +
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_storage); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* … */ __pyx_t_13 = 54; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[5]); #endif __pyx_t_2 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 |= __Pyx_PyUnicode_KIND_04(__pyx_t_12[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[5]); #endif __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, __pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_15 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2849, __pyx_L1_error) } __pyx_L4:;
+2852: f'for column {pandas_col.name} of dtype {dtype}.')
__pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_v_pandas_col->name); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 2852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Unknown_string_dtype_storage_f; __pyx_t_12[1] = __pyx_t_11; __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_12[3] = __pyx_t_9; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_of_dtype; __pyx_t_12[5] = __pyx_t_14; __pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u__3;
+2853: elif isinstance(dtype, _PANDAS.CategoricalDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_CategoricalDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2854: _dataframe_category_series_as_arrow(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_category_series_as_arrow(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2854, __pyx_L1_error)
+2855: elif isinstance(dtype, _NUMPY_OBJECT):
__pyx_t_1 = __pyx_v_7questdb_7_client__NUMPY_OBJECT; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* … */ goto __pyx_L3; }
+2856: _dataframe_series_sniff_pyobj(pandas_col, col)
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_sniff_pyobj(__pyx_v_pandas_col, __pyx_v_col); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2856, __pyx_L1_error)
+2857: elif isinstance(dtype, _PANDAS.ArrowDtype):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7questdb_7_client__PANDAS, __pyx_mstate_global->__pyx_n_u_ArrowDtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_IsInstance(__pyx_v_dtype, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 2857, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_3)) { /* … */ goto __pyx_L3; }
+2858: _dataframe_series_resolve_arrow(
__pyx_t_4 = __pyx_f_7questdb_7_client__dataframe_series_resolve_arrow(__pyx_v_pandas_col, __pyx_t_1, __pyx_v_col, __pyx_v_qwp_planner); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2859: pandas_col, dtype.pyarrow_dtype, col, qwp_planner)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_mstate_global->__pyx_n_u_pyarrow_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1);
2860: else:
+2861: raise QuestDBError(
/*else*/ {
__pyx_t_10 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
+2862: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+2863: f'Unsupported dtype {dtype} for column {pandas_col.name!r}. ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_Unsupported_dtype; __pyx_t_16[1] = __pyx_t_6; __pyx_t_16[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_16[3] = __pyx_t_14; __pyx_t_16[4] = __pyx_mstate_global->__pyx_kp_u_Raise_an_issue_if_you_think_it; __pyx_t_13 = 136; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16[3]); #endif __pyx_t_2 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_2 |= __Pyx_PyUnicode_KIND_04(__pyx_t_16[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_16[3]); #endif __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_16, 5, __pyx_t_13, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_10); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_15 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_7, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2861, __pyx_L1_error) } __pyx_L3:;
2864: 'Raise an issue if you think it should be supported: ' +
2865: 'https://github.com/questdb/py-questdb-client/issues.')
2866:
+2867: cdef void_int _dataframe_resolve_target(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_target(struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyObject *__pyx_v_field_targets) {
enum __pyx_t_7questdb_7_client_col_target_t __pyx_v_target;
PyObject *__pyx_v_target_sources = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_target", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_target_sources);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2868: PandasCol pandas_col, col_t* col, tuple field_targets) except -1:
2869: cdef col_target_t target
2870: cdef set target_sources
+2871: if col.setup.meta_target in _DIRECT_META_TARGETS:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_meta_target_t(__pyx_v_col->setup->meta_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_7questdb_7_client__DIRECT_META_TARGETS == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable"); __PYX_ERR(2, 2871, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__DIRECT_META_TARGETS, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* … */ }
+2872: col.setup.target = <col_target_t><int>col.setup.meta_target
__pyx_v_col->setup->target = ((enum __pyx_t_7questdb_7_client_col_target_t)((int)__pyx_v_col->setup->meta_target));
+2873: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+2874: for target in field_targets:
if (unlikely(__pyx_v_field_targets == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable");
__PYX_ERR(2, 2874, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_field_targets; __Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 2874, __pyx_L1_error)
#endif
if (__pyx_t_3 >= __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_3));
#else
__pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
#endif
++__pyx_t_3;
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2874, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = ((enum __pyx_t_7questdb_7_client_col_target_t)__Pyx_PyLong_As_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 2874, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_target = __pyx_t_5;
/* … */
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+2875: target_sources = _TARGET_TO_SOURCES[target]
if (unlikely(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 2875, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PySet_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_6))) __PYX_ERR(2, 2875, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_target_sources, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
+2876: if col.setup.source in target_sources:
__pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_target_sources == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not iterable"); __PYX_ERR(2, 2876, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_target_sources, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2876, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { /* … */ }
+2877: col.setup.target = target
__pyx_v_col->setup->target = __pyx_v_target;
+2878: return 0
{
__pyx_r = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
+2879: if col.setup.source in _COLUMNAR_ONLY_PYOBJ_SOURCES:
__pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_7questdb_7_client__COLUMNAR_ONLY_PYOBJ_SOURCES, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 2879, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { /* … */ }
2880: # `QuestDB.dataframe()` is named with the configuration that
2881: # reaches it: `questdb.connect()` takes `ws::` / `wss::` only,
2882: # so a `udp::` or ILP sender told to go there would find no
2883: # door. `Sender.row()` is the one that opens from where they
2884: # are, on any QWP protocol.
+2885: raise QuestDBError(
__pyx_t_6 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
+2886: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+2887: f'Column {pandas_col.name!r} holds '
__pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* … */ __pyx_t_3 = 287; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]); #endif __pyx_t_12 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_11[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_11[3]); #endif __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = 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_13 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__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_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2885, __pyx_L1_error)
+2888: f'{_PYOBJ_SOURCE_DESCR[col.setup.source]} objects, which the '
if (unlikely(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 2888, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__PYOBJ_SOURCE_DESCR, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Column_2;
__pyx_t_11[1] = __pyx_t_7;
__pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_holds;
__pyx_t_11[3] = __pyx_t_9;
__pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_objects_which_the_row_serializi;
2889: f'row-serializing Sender.dataframe() cannot write on any '
2890: f'protocol. Pass the values to Sender.row(), which takes them '
2891: f'on a udp::, ws:: or wss:: sender, or write the frame with '
2892: f'QuestDB.dataframe() over a ws:: or wss:: configuration, '
2893: f'which sends it columnar.')
+2894: raise QuestDBError(
__pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10);
+2895: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+2896: f'Could not map column source type (code {col.setup.source} for ' +
__pyx_t_8 = __Pyx_PyUnicode_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 2896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* … */ __pyx_t_3 = 72; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14[5]); #endif __pyx_t_12 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_12 |= __Pyx_PyUnicode_KIND_04(__pyx_t_14[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_14[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_14[5]); #endif __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_14, 7, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 2896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_13 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_13 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_15}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__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_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 2894, __pyx_L1_error)
+2897: f'column {pandas_col.name!r} ' +
__pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
+2898: f' ({pandas_col.dtype}) to any ILP type.')
__pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_Could_not_map_column_source_type; __pyx_t_14[1] = __pyx_t_8; __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_for_column; __pyx_t_14[3] = __pyx_t_9; __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__20; __pyx_t_14[5] = __pyx_t_7; __pyx_t_14[6] = __pyx_mstate_global->__pyx_kp_u_to_any_ILP_type;
2899:
2900:
+2901: cdef void _dataframe_init_cursor(col_t* col) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_init_cursor(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
/* … */
/* function exit code */
}
+2902: col.cursor.chunk = col.setup.chunks.chunks
__pyx_t_1 = __pyx_v_col->setup->chunks.chunks; __pyx_v_col->cursor.chunk = __pyx_t_1;
+2903: col.cursor.chunk_index = 0
__pyx_v_col->cursor.chunk_index = 0;
+2904: while ((col.cursor.chunk_index < col.setup.chunks.n_chunks) and
while (1) {
__pyx_t_3 = (__pyx_v_col->cursor.chunk_index < __pyx_v_col->setup->chunks.n_chunks);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L5_bool_binop_done;
}
+2905: (col.cursor.chunk.length == 0)):
__pyx_t_3 = (__pyx_v_col->cursor.chunk->length == 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (!__pyx_t_2) break;
+2906: col.cursor.chunk_index += 1
__pyx_v_col->cursor.chunk_index = (__pyx_v_col->cursor.chunk_index + 1);
+2907: col.cursor.chunk += 1
__pyx_v_col->cursor.chunk = (__pyx_v_col->cursor.chunk + 1); }
+2908: col.cursor.offset = col.cursor.chunk.offset
__pyx_t_4 = __pyx_v_col->cursor.chunk->offset; __pyx_v_col->cursor.offset = __pyx_t_4;
+2909: col.cursor.dictionary_large_offsets = (
__pyx_v_col->cursor.dictionary_large_offsets = __pyx_t_2;
+2910: col.setup.arrow_schema.dictionary != NULL and
__pyx_t_3 = (__pyx_v_col->setup->arrow_schema.dictionary != NULL);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
2911: strncmp(
2912: col.setup.arrow_schema.dictionary.format,
2913: _ARROW_FMT_LRG_UTF8_STRING,
+2914: 1) == 0)
__pyx_t_3 = (strncmp(__pyx_v_col->setup->arrow_schema.dictionary->format, __pyx_v_7questdb_7_client__ARROW_FMT_LRG_UTF8_STRING, 1) == 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:;
2915:
2916:
+2917: cdef void_int _dataframe_resolve_cols(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_cols(CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, int *__pyx_v_any_cols_need_gil_out, int __pyx_v_qwp_planner) {
size_t __pyx_v_index;
size_t __pyx_v_len_dataframe_cols;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_cols", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2918: qdb_pystr_buf* b,
2919: list pandas_cols,
2920: col_t_arr* cols,
2921: bint* any_cols_need_gil_out,
2922: bint qwp_planner) except -1:
2923: cdef size_t index
+2924: cdef size_t len_dataframe_cols = len(pandas_cols)
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
__PYX_ERR(2, 2924, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyList_GET_SIZE(__pyx_v_pandas_cols); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 2924, __pyx_L1_error)
__pyx_v_len_dataframe_cols = __pyx_t_1;
2925: cdef PandasCol pandas_col
2926: cdef col_t* col
+2927: any_cols_need_gil_out[0] = False
(__pyx_v_any_cols_need_gil_out[0]) = 0;
+2928: for index in range(len_dataframe_cols):
__pyx_t_2 = __pyx_v_len_dataframe_cols;
__pyx_t_3 = __pyx_t_2;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_index = __pyx_t_4;
+2929: pandas_col = pandas_cols[index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 2929, __pyx_L1_error)
}
__pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 2929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 2929, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_5));
__pyx_t_5 = 0;
+2930: col = &cols.d[index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_index]));
2931:
2932: # The target is resolved in stages:
2933: # * We first assign all column `.meta_target`s to be fields.
2934: # * Then, depending on argument parsing some/none of the columns
2935: # obtain a meta-target of "table", "symbol" or "at".
2936: # * Finally, based on the source, any remaining "meta_target_field"
2937: # columns are converted to the appropriate target.
2938: # See: _dataframe_resolve_col_targets_and_dc(..).
+2939: col.setup.meta_target = meta_target_t.meta_target_field
__pyx_v_col->setup->meta_target = __pyx_e_7questdb_7_client_meta_target_field;
2940:
2941: # We will sort columns later. The index will be used to achieve a stable
2942: # sort among columns with the same `.meta_target`.
+2943: col.setup.orig_index = index
__pyx_v_col->setup->orig_index = __pyx_v_index;
2944:
+2945: _dataframe_resolve_source_and_buffers(pandas_col, col, qwp_planner)
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_resolve_source_and_buffers(__pyx_v_pandas_col, __pyx_v_col, __pyx_v_qwp_planner); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2945, __pyx_L1_error)
+2946: _dataframe_init_cursor(col)
__pyx_f_7questdb_7_client__dataframe_init_cursor(__pyx_v_col);
+2947: if col_source_needs_gil(col.setup.source):
__pyx_t_7 = __pyx_f_7questdb_7_client_col_source_needs_gil(__pyx_v_col->setup->source);
if (__pyx_t_7) {
/* … */
}
}
+2948: any_cols_need_gil_out[0] = True
(__pyx_v_any_cols_need_gil_out[0]) = 1;
2949:
2950:
+2951: cdef void_int _dataframe_resolve_cols_target_name_and_dc(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_cols_target_name_and_dc(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_pandas_cols, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, PyObject *__pyx_v_field_targets) {
size_t __pyx_v_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_cols_target_name_and_dc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2952: qdb_pystr_buf* b,
2953: list pandas_cols,
2954: col_t_arr* cols,
2955: tuple field_targets) except -1:
2956: cdef size_t index
2957: cdef col_t* col
2958: cdef PandasCol pandas_col
+2959: for index in range(cols.size):
__pyx_t_1 = __pyx_v_cols->size;
__pyx_t_2 = __pyx_t_1;
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_index = __pyx_t_3;
+2960: col = &cols.d[index]
__pyx_v_col = (&(__pyx_v_cols->d[__pyx_v_index]));
+2961: pandas_col = pandas_cols[index]
if (unlikely(__pyx_v_pandas_cols == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 2961, __pyx_L1_error)
}
__pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_pandas_cols, __pyx_v_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2961, __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_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 2961, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_4));
__pyx_t_4 = 0;
+2962: _dataframe_resolve_target(pandas_col, col, field_targets)
__pyx_t_5 = __pyx_f_7questdb_7_client__dataframe_resolve_target(__pyx_v_pandas_col, __pyx_v_col, __pyx_v_field_targets); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2962, __pyx_L1_error)
+2963: if col.setup.source not in _TARGET_TO_SOURCES[col.setup.target]:
__pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_source_t(__pyx_v_col->setup->source); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 2963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES == Py_None)) { PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable"); __PYX_ERR(2, 2963, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_TO_SOURCES, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_7, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(2, 2963, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_t_8)) { /* … */ }
+2964: raise ValueError(
__pyx_t_4 = NULL;
+2965: f'Bad value: Column {pandas_col.name!r} ' +
__pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_pandas_col->name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 2965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* … */ __pyx_t_13 = 52; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[3]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12[5]); #endif __pyx_t_14 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_14 |= __Pyx_PyUnicode_KIND_04(__pyx_t_12[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[3]) | __Pyx_PyUnicode_KIND_04(__pyx_t_12[5]); #endif __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_12, 7, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_15 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 2964, __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(2, 2964, __pyx_L1_error)
+2966: f'({pandas_col.dtype}) is not ' +
__pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_pandas_col->dtype, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 2966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
+2967: f'supported as a {_TARGET_NAMES[col.setup.target]} column.')
if (unlikely(__pyx_v_7questdb_7_client__TARGET_NAMES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 2967, __pyx_L1_error)
}
__pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_NAMES, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 2967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 2967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_Bad_value_Column;
__pyx_t_12[1] = __pyx_t_6;
__pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u__15;
__pyx_t_12[3] = __pyx_t_9;
__pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_is_not_supported_as_a;
__pyx_t_12[5] = __pyx_t_10;
__pyx_t_12[6] = __pyx_mstate_global->__pyx_kp_u_column;
+2968: col.dispatch_code = <col_dispatch_code_t>(
__pyx_v_col->dispatch_code = ((enum __pyx_t_7questdb_7_client_col_dispatch_code_t)(((int)__pyx_v_col->setup->source) + ((int)__pyx_v_col->setup->target)));
2969: <int>col.setup.source + <int>col.setup.target)
2970:
2971: # Since we don't need to send the column names for 'table' and
2972: # 'at' columns, we don't need to validate and encode them as
2973: # column names. This allows unsupported names for these columns.
+2974: if ((col.setup.meta_target != meta_target_t.meta_target_table) and
switch (__pyx_v_col->setup->meta_target) {
case __pyx_e_7questdb_7_client_meta_target_table:
case __pyx_e_7questdb_7_client_meta_target_at:
/* … */
__pyx_t_8 = 0;
/* … */
break;
default:
__pyx_t_8 = 1;
break;
}
if (__pyx_t_8) {
/* … */
}
}
2975: (col.setup.meta_target != meta_target_t.meta_target_at)):
+2976: str_to_column_name_copy(b, pandas_col.name, &col.name)
__pyx_t_7 = __pyx_v_pandas_col->name;
__Pyx_INCREF(__pyx_t_7);
__pyx_t_5 = __pyx_f_7questdb_7_client_str_to_column_name_copy(__pyx_v_b, ((PyObject*)__pyx_t_7), (&__pyx_v_col->name)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 2976, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2977:
2978:
+2979: cdef int _dataframe_compare_cols(const void* lhs, const void* rhs) noexcept nogil:
static int __pyx_f_7questdb_7_client__dataframe_compare_cols(void const *__pyx_v_lhs, void const *__pyx_v_rhs) {
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_lhs_col;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_rhs_col;
int __pyx_v_source_diff;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
+2980: cdef col_t* lhs_col = <col_t*>lhs
__pyx_v_lhs_col = ((struct __pyx_t_7questdb_7_client_col_t *)__pyx_v_lhs);
+2981: cdef col_t* rhs_col = <col_t*>rhs
__pyx_v_rhs_col = ((struct __pyx_t_7questdb_7_client_col_t *)__pyx_v_rhs);
+2982: cdef int source_diff = lhs_col.setup.meta_target - rhs_col.setup.meta_target
__pyx_v_source_diff = (__pyx_v_lhs_col->setup->meta_target - __pyx_v_rhs_col->setup->meta_target);
+2983: if source_diff != 0:
__pyx_t_1 = (__pyx_v_source_diff != 0);
if (__pyx_t_1) {
/* … */
}
+2984: return source_diff
{
__pyx_r = __pyx_v_source_diff;
}
goto __pyx_L0;
+2985: return <int>lhs_col.setup.orig_index - <int>rhs_col.setup.orig_index
{
__pyx_r = (((int)__pyx_v_lhs_col->setup->orig_index) - ((int)__pyx_v_rhs_col->setup->orig_index));
}
goto __pyx_L0;
2986:
2987: # noinspection PyUnreachableCode
+2988: cdef void_int _dataframe_resolve_args(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_resolve_args(PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at, struct qdb_pystr_buf *__pyx_v_b, size_t __pyx_v_col_count, struct line_sender_table_name *__pyx_v_c_table_name_out, int64_t *__pyx_v_at_value_out, struct __pyx_t_7questdb_7_client_col_t_arr *__pyx_v_cols, int *__pyx_v_any_cols_need_gil_out, PyObject *__pyx_v_field_targets) {
Py_ssize_t __pyx_v_name_col;
Py_ssize_t __pyx_v_at_col;
PyObject *__pyx_v_cols_meta = 0;
struct __pyx_obj_7questdb_7_client_PandasCol *__pyx_v_pandas_col = 0;
PyObject *__pyx_v_pandas_cols = 0;
int __pyx_v_qwp_planner;
PyObject *__pyx_8genexpr2__pyx_v_index = NULL;
PyObject *__pyx_8genexpr2__pyx_v_name = NULL;
PyObject *__pyx_8genexpr2__pyx_v_series = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("questdb._client._dataframe_resolve_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_cols_meta);
__Pyx_XDECREF((PyObject *)__pyx_v_pandas_col);
__Pyx_XDECREF(__pyx_v_pandas_cols);
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index);
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_name);
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_series);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
2989: object df,
2990: object table_name,
2991: object table_name_col,
2992: object symbols,
2993: object at,
2994: qdb_pystr_buf* b,
2995: size_t col_count,
2996: line_sender_table_name* c_table_name_out,
2997: int64_t* at_value_out,
2998: col_t_arr* cols,
2999: bint* any_cols_need_gil_out,
3000: tuple field_targets) except -1:
3001: cdef ssize_t name_col
3002: cdef ssize_t at_col
3003: cdef object cols_meta
3004: cdef PandasCol pandas_col
3005:
+3006: cdef list pandas_cols = [
{ /* enter inner scope */
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3006, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
__pyx_t_2 = __pyx_mstate_global->__pyx_int_0;
+3007: PandasCol(name, df.dtypes.iloc[index], series)
__pyx_t_7 = NULL;
__pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_dtypes); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3007, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 3007, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_8genexpr2__pyx_v_index); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3007, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12 = 1;
{
PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_8genexpr2__pyx_v_name, __pyx_t_10, __pyx_8genexpr2__pyx_v_series};
__pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7questdb_7_client_PandasCol, __pyx_callargs+__pyx_t_12, (4-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 3007, __pyx_L5_error)
__Pyx_GOTREF((PyObject *)__pyx_t_8);
}
__Pyx_GIVEREF((PyObject *)__pyx_t_8);
if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, ((PyObject *)__pyx_t_8)))) __PYX_ERR(2, 3006, __pyx_L5_error)
__pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index); __pyx_8genexpr2__pyx_v_index = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_name); __pyx_8genexpr2__pyx_v_name = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_series); __pyx_8genexpr2__pyx_v_series = 0;
goto __pyx_L8_exit_scope;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_index); __pyx_8genexpr2__pyx_v_index = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_name); __pyx_8genexpr2__pyx_v_name = 0;
__Pyx_XDECREF(__pyx_8genexpr2__pyx_v_series); __pyx_8genexpr2__pyx_v_series = 0;
goto __pyx_L1_error;
__pyx_L8_exit_scope:;
} /* exit inner scope */
__pyx_v_pandas_cols = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
+3008: for index, (name, series) in enumerate(df.items())]
__pyx_t_4 = 0;
if (unlikely(__pyx_v_df == Py_None)) {
PyErr_Format(PyExc_AttributeError, "\047NoneType\047 object has no attribute \047%.30s\047", "items");
__PYX_ERR(2, 3008, __pyx_L5_error)
}
__pyx_t_7 = __Pyx_dict_iterator(__pyx_v_df, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3008, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_3);
__pyx_t_3 = __pyx_t_7;
__pyx_t_7 = 0;
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, &__pyx_t_8, NULL, __pyx_t_6);
if (unlikely(__pyx_t_9 == 0)) break;
if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 3008, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_name, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_series, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_index, __pyx_t_2);
__pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_2, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 3008, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2);
__pyx_t_2 = __pyx_t_8;
__pyx_t_8 = 0;
+3009: cdef bint qwp_planner = field_targets is _FIELD_TARGETS_QWP
__pyx_t_13 = (__pyx_v_field_targets == __pyx_v_7questdb_7_client__FIELD_TARGETS_QWP); __pyx_v_qwp_planner = __pyx_t_13;
+3010: if qwp_planner:
if (__pyx_v_qwp_planner) {
/* … */
}
3011: # The classifier reads the claim for one shape only: a bare
3012: # 16- or 32-byte Arrow column, which it refuses without one.
+3013: cols_meta = _roundtrip_columns_meta(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__roundtrip_columns_meta(__pyx_v_df); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols_meta = __pyx_t_1; __pyx_t_1 = 0;
+3014: if cols_meta:
__pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_cols_meta); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(2, 3014, __pyx_L1_error) if (__pyx_t_13) { /* … */ }
+3015: for pandas_col in pandas_cols:
__pyx_t_1 = __pyx_v_pandas_cols; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 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(2, 3015, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3015, __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_7questdb_7_client_PandasCol))))) __PYX_ERR(2, 3015, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_pandas_col, ((struct __pyx_obj_7questdb_7_client_PandasCol *)__pyx_t_2)); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3016: pandas_col.claim_kind = _roundtrip_kind(
__pyx_t_3 = __pyx_f_7questdb_7_client__roundtrip_kind(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_pandas_col->claim_kind); __Pyx_DECREF(__pyx_v_pandas_col->claim_kind); __pyx_v_pandas_col->claim_kind = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0;
+3017: cols_meta.get(pandas_col.name))
__pyx_t_3 = __pyx_v_cols_meta;
__Pyx_INCREF(__pyx_t_3);
__pyx_t_12 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_pandas_col->name};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3017, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
+3018: _dataframe_resolve_cols(
__pyx_t_14 = __pyx_f_7questdb_7_client__dataframe_resolve_cols(__pyx_v_b, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_any_cols_need_gil_out, __pyx_v_qwp_planner); if (unlikely(__pyx_t_14 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3018, __pyx_L1_error)
3019: b, pandas_cols, cols, any_cols_need_gil_out, qwp_planner)
+3020: name_col = _dataframe_resolve_table_name(
__pyx_t_15 = __pyx_f_7questdb_7_client__dataframe_resolve_table_name(__pyx_v_b, __pyx_v_df, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_col_count, __pyx_v_c_table_name_out); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-2L))) __PYX_ERR(2, 3020, __pyx_L1_error)
__pyx_v_name_col = __pyx_t_15;
3021: b,
3022: df,
3023: pandas_cols,
3024: cols,
3025: table_name,
3026: table_name_col,
3027: col_count,
3028: c_table_name_out)
+3029: at_col = _dataframe_resolve_at(
__pyx_t_15 = __pyx_f_7questdb_7_client__dataframe_resolve_at(__pyx_v_df, __pyx_v_cols, __pyx_v_at, __pyx_v_col_count, __pyx_v_at_value_out, __pyx_v_qwp_planner); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-2L))) __PYX_ERR(2, 3029, __pyx_L1_error)
__pyx_v_at_col = __pyx_t_15;
3030: df, cols, at, col_count, at_value_out, qwp_planner)
+3031: _dataframe_resolve_symbols(df, pandas_cols, cols, name_col, at_col, symbols)
__pyx_t_14 = __pyx_f_7questdb_7_client__dataframe_resolve_symbols(__pyx_v_df, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_name_col, __pyx_v_at_col, __pyx_v_symbols); if (unlikely(__pyx_t_14 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3031, __pyx_L1_error)
+3032: _dataframe_resolve_cols_target_name_and_dc(
__pyx_t_14 = __pyx_f_7questdb_7_client__dataframe_resolve_cols_target_name_and_dc(__pyx_v_b, __pyx_v_pandas_cols, __pyx_v_cols, __pyx_v_field_targets); if (unlikely(__pyx_t_14 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3032, __pyx_L1_error)
3033: b, pandas_cols, cols, field_targets)
+3034: qsort(cols.d, col_count, sizeof(col_t), _dataframe_compare_cols)
qsort(__pyx_v_cols->d, __pyx_v_col_count, (sizeof(struct __pyx_t_7questdb_7_client_col_t)), __pyx_f_7questdb_7_client__dataframe_compare_cols);
3035:
3036:
+3037: cdef void_int _dataframe_plan_build(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_plan_build(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at, struct __pyx_t_7questdb_7_client_dataframe_plan_t *__pyx_v_plan, PyObject *__pyx_v_field_targets) {
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_plan_build", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3038: qdb_pystr_buf* b,
3039: object df,
3040: object table_name,
3041: object table_name_col,
3042: object symbols,
3043: object at,
3044: dataframe_plan_t* plan,
3045: tuple field_targets) except -1:
+3046: _dataframe_may_import_deps()
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_may_import_deps(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3047: _dataframe_check_is_dataframe(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_check_is_dataframe(__pyx_v_df); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+3048: plan.row_count = len(df)
__pyx_t_2 = PyObject_Length(__pyx_v_df); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 3048, __pyx_L1_error) __pyx_v_plan->row_count = __pyx_t_2;
+3049: if (len(df.columns) == 0) or (plan.row_count == 0):
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 3049, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_2 == 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_plan->row_count == 0); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* … */ }
+3050: plan.col_count = 0
__pyx_v_plan->col_count = 0;
+3051: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
3052:
+3053: plan.col_count = len(df.columns)
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 3053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_plan->col_count = __pyx_t_2;
+3054: qdb_pystr_buf_clear(b)
qdb_pystr_buf_clear(__pyx_v_b);
+3055: plan.cols = col_t_arr_new(plan.col_count)
__pyx_v_plan->cols = __pyx_f_7questdb_7_client_col_t_arr_new(__pyx_v_plan->col_count);
+3056: if plan.cols.d == NULL:
__pyx_t_3 = (__pyx_v_plan->cols.d == NULL);
if (unlikely(__pyx_t_3)) {
/* … */
}
+3057: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(2, 3057, __pyx_L1_error)
+3058: _dataframe_resolve_args(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_resolve_args(__pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_t_1, __pyx_v_b, __pyx_v_plan->col_count, (&__pyx_v_plan->c_table_name), (&__pyx_v_plan->at_value), (&__pyx_v_plan->cols), (&__pyx_v_plan->any_cols_need_gil), __pyx_v_field_targets); if (unlikely(__pyx_t_6 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3058, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3059: df,
3060: table_name,
3061: table_name_col,
3062: symbols,
+3063: at if not isinstance(at, ServerTimestampType) else None,
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ServerTimestampType); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyObject_IsInstance(__pyx_v_at, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 3063, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { __Pyx_INCREF(__pyx_v_at); __pyx_t_1 = __pyx_v_at; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; }
3064: b,
3065: plan.col_count,
3066: &plan.c_table_name,
3067: &plan.at_value,
3068: &plan.cols,
3069: &plan.any_cols_need_gil,
3070: field_targets)
3071:
3072: # Headers and table names stored in `b` are borrowed by the plan.
3073: # Serialization rewinds to this point for every row without dropping
3074: # those borrowed strings.
+3075: plan.str_buf_marker = qdb_pystr_buf_tell(b)
__pyx_v_plan->str_buf_marker = qdb_pystr_buf_tell(__pyx_v_b);
3076:
3077:
+3078: cdef object _dataframe_plan_debug_str(const char* buf, size_t length):
static PyObject *__pyx_f_7questdb_7_client__dataframe_plan_debug_str(char const *__pyx_v_buf, size_t __pyx_v_length) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_plan_debug_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+3079: if buf == NULL:
__pyx_t_1 = (__pyx_v_buf == NULL);
if (__pyx_t_1) {
/* … */
}
+3080: return None
{
PyObject *__pyx_temp;
{
__pyx_temp = __pyx_r;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
}
__Pyx_XDECREF(__pyx_temp);
}
goto __pyx_L0;
+3081: return PyUnicode_FromStringAndSize(buf, <Py_ssize_t>length)
__pyx_t_2 = PyUnicode_FromStringAndSize(__pyx_v_buf, ((Py_ssize_t)__pyx_v_length)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_2; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_2 = 0; goto __pyx_L0;
3082:
3083:
+3084: def _debug_dataframe_plan(
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7_client_3_debug_dataframe_plan(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
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_7questdb_7_client_3_debug_dataframe_plan = {"_debug_dataframe_plan", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7questdb_7_client_3_debug_dataframe_plan, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7_client_3_debug_dataframe_plan(PyObject *__pyx_self,
#if CYTHON_VECTORCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_df = 0;
PyObject *__pyx_v_table_name = 0;
PyObject *__pyx_v_table_name_col = 0;
PyObject *__pyx_v_symbols = 0;
PyObject *__pyx_v_at = 0;
#if !CYTHON_VECTORCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_debug_dataframe_plan (wrapper)", 0);
#if !CYTHON_VECTORCALL
#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_df_2,&__pyx_mstate_global->__pyx_n_u_table_name,&__pyx_mstate_global->__pyx_n_u_table_name_col,&__pyx_mstate_global->__pyx_n_u_symbols,&__pyx_mstate_global->__pyx_n_u_at,0};
PyObject* values[5] = {0,0,0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 3084, __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(2, 3084, __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, "_debug_dataframe_plan", 0) < (0)) __PYX_ERR(2, 3084, __pyx_L3_error)
/* … */
/* 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_7questdb_7_client_2_debug_dataframe_plan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
struct qdb_pystr_buf *__pyx_v_b;
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
size_t __pyx_v_col_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_at_value = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* 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_10);
__Pyx_AddTraceback("questdb._client._debug_dataframe_plan", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_cols);
__Pyx_XDECREF(__pyx_v_at_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_16 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 3084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_16);
/* … */
__pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7_client_3_debug_dataframe_plan, 0, __pyx_mstate_global->__pyx_n_u_debug_dataframe_plan, NULL, __pyx_mstate_global->__pyx_n_u_questdb__client, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 3084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
#endif
__Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_17, __pyx_t_16);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_debug_dataframe_plan, __pyx_t_17) < (0)) __PYX_ERR(2, 3084, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3085: object df,
3086: *,
+3087: object table_name=None,
if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); /* … */ if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); /* … */ if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_table_name, Py_None) < (0)) __PYX_ERR(2, 3084, __pyx_L1_error)
+3088: object table_name_col=None,
if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto))); /* … */ if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto))); /* … */ if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_table_name_col, Py_None) < (0)) __PYX_ERR(2, 3084, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_symbols, ((PyObject*)__pyx_mstate_global->__pyx_n_u_auto)) < (0)) __PYX_ERR(2, 3084, __pyx_L1_error)
3089: object symbols='auto',
+3090: object at=None):
if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_debug_dataframe_plan", 1, 1, 1, i); __PYX_ERR(2, 3084, __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(2, 3084, __pyx_L3_error) /* … */ if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None)); } __pyx_v_df = values[0]; __pyx_v_table_name = values[1]; __pyx_v_table_name_col = values[2]; __pyx_v_symbols = values[3]; __pyx_v_at = values[4]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_debug_dataframe_plan", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3084, __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("questdb._client._debug_dataframe_plan", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7questdb_7_client_2_debug_dataframe_plan(__pyx_self, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at); /* … */ if (PyDict_SetItem(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_at, Py_None) < (0)) __PYX_ERR(2, 3084, __pyx_L1_error)
+3091: cdef qdb_pystr_buf* b = qdb_pystr_buf_new()
__pyx_v_b = qdb_pystr_buf_new();
+3092: cdef dataframe_plan_t plan = dataframe_plan_blank()
__pyx_v_plan = __pyx_f_7questdb_7_client_dataframe_plan_blank();
3093: cdef size_t col_index
3094: cdef col_t* col
+3095: cdef list cols = []
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+3096: try:
/*try:*/ {
+3097: _dataframe_plan_build(
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_plan_build(__pyx_v_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at, (&__pyx_v_plan), ((PyObject*)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3097, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3098: b,
3099: df,
3100: table_name,
3101: table_name_col,
3102: symbols,
3103: at,
3104: &plan,
+3105: _FIELD_TARGETS_ROW)
__pyx_t_1 = __pyx_v_7questdb_7_client__FIELD_TARGETS_ROW;
__Pyx_INCREF(__pyx_t_1);
+3106: for col_index in range(plan.col_count):
__pyx_t_3 = __pyx_v_plan.col_count;
__pyx_t_4 = __pyx_t_3;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_col_index = __pyx_t_5;
+3107: col = &plan.cols.d[col_index]
__pyx_v_col = (&(__pyx_v_plan.cols.d[__pyx_v_col_index]));
+3108: cols.append({
__pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cols, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 3108, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; }
+3109: 'orig_index': col.setup.orig_index,
__pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_col->setup->orig_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orig_index, __pyx_t_6) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3110: 'orig_name': df.columns[col.setup.orig_index],
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3110, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_col->setup->orig_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3110, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_orig_name, __pyx_t_7) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+3111: 'target': _TARGET_NAMES[col.setup.target],
if (unlikely(__pyx_v_7questdb_7_client__TARGET_NAMES == Py_None)) {
PyErr_SetString(PyExc_TypeError, "\047NoneType\047 object is not subscriptable");
__PYX_ERR(2, 3111, __pyx_L4_error)
}
__pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7questdb_7_client_col_target_t(__pyx_v_col->setup->target); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 3111, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_7questdb_7_client__TARGET_NAMES, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3111, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target, __pyx_t_6) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3112: 'target_name': _dataframe_plan_debug_str(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_plan_debug_str(__pyx_v_col->name.buf, __pyx_v_col->name.len); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3112, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_target_name, __pyx_t_6) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3113: col.name.buf,
3114: col.name.len),
+3115: 'source_code': <int>col.setup.source,
__pyx_t_6 = __Pyx_PyLong_From_int(((int)__pyx_v_col->setup->source)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3115, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_source_code, __pyx_t_6) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3116: 'dispatch_code': <int>col.dispatch_code,
__pyx_t_6 = __Pyx_PyLong_From_int(((int)__pyx_v_col->dispatch_code)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3116, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_dispatch_code, __pyx_t_6) < (0)) __PYX_ERR(2, 3109, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3117: })
+3118: if plan.at_value == _AT_IS_SERVER_NOW:
__pyx_t_9 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW);
if (__pyx_t_9) {
/* … */
goto __pyx_L8;
}
+3119: at_value = 'server_now'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_server_now);
__pyx_v_at_value = __pyx_mstate_global->__pyx_n_u_server_now;
+3120: elif plan.at_value == _AT_IS_SET_BY_COLUMN:
__pyx_t_9 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SET_BY_COLUMN);
if (__pyx_t_9) {
/* … */
goto __pyx_L8;
}
+3121: at_value = 'column'
__Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_column_2);
__pyx_v_at_value = __pyx_mstate_global->__pyx_n_u_column_2;
3122: else:
+3123: at_value = plan.at_value
/*else*/ {
__pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_plan.at_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3123, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_at_value = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L8:;
3124: return {
+3125: 'row_count': plan.row_count,
__pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3125, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_plan.row_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3125, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_row_count, __pyx_t_6) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3126: 'col_count': plan.col_count,
__pyx_t_6 = __Pyx_PyLong_FromSize_t(__pyx_v_plan.col_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3126, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_col_count, __pyx_t_6) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+3127: 'fixed_table_name': _dataframe_plan_debug_str(
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_plan_debug_str(__pyx_v_plan.c_table_name.buf, __pyx_v_plan.c_table_name.len); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3127, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_fixed_table_name, __pyx_t_6) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3128: plan.c_table_name.buf,
3129: plan.c_table_name.len),
+3130: 'at_value': at_value,
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_at_value, __pyx_v_at_value) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error)
+3131: 'any_cols_need_gil': bool(plan.any_cols_need_gil),
__pyx_t_7 = NULL;
__pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_plan.any_cols_need_gil); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3131, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_3 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
__pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3131, __pyx_L4_error)
__Pyx_GOTREF((PyObject *)__pyx_t_6);
}
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_any_cols_need_gil, ((PyObject *)__pyx_t_6)) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error)
__Pyx_DECREF((PyObject *)__pyx_t_6); __pyx_t_6 = 0;
+3132: 'cols': cols,
if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_cols, __pyx_v_cols) < (0)) __PYX_ERR(2, 3125, __pyx_L4_error) { PyObject *__pyx_temp; { __pyx_temp = __pyx_r; __pyx_r = __pyx_t_1; } __Pyx_XDECREF(__pyx_temp); } __pyx_t_1 = 0; goto __pyx_L3_return; }
3133: }
3134: finally:
+3135: dataframe_plan_release(&plan)
/*finally:*/ {
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
if ( unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
__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_XGOTREF(__pyx_t_19);
__pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
{
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
+3136: qdb_pystr_buf_free(b)
qdb_pystr_buf_free(__pyx_v_b);
}
__Pyx_XGIVEREF(__pyx_t_17);
__Pyx_XGIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_19);
__Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
__pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
goto __pyx_L1_error;
}
__pyx_L3_return: {
__pyx_t_19 = __pyx_r;
__pyx_r = 0;
/* … */
qdb_pystr_buf_free(__pyx_v_b);
__pyx_r = __pyx_t_19;
__pyx_t_19 = 0;
goto __pyx_L0;
}
}
3137:
3138:
+3139: cdef inline bint _dataframe_arrow_get_bool(col_cursor_t* cursor) noexcept nogil:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_bool(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3140: return (
+3141: (<uint8_t*>cursor.chunk.buffers[1])[cursor.offset // 8] &
{
__pyx_r = ((((uint8_t *)(__pyx_v_cursor->chunk->buffers[1]))[(__pyx_v_cursor->offset / 8)]) & (1 << (__pyx_v_cursor->offset % 8)));
}
goto __pyx_L0;
3142: (1 << (cursor.offset % 8))
3143: )
3144:
3145:
+3146: cdef inline bint _dataframe_arrow_is_valid(col_cursor_t* cursor) noexcept nogil:
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3147: """Check if the value is set according to the validity bitmap."""
3148: return (
+3149: cursor.chunk.null_count == 0 or
__pyx_t_2 = (__pyx_v_cursor->chunk->null_count == 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L3_bool_binop_done;
}
3150: (
+3151: (<uint8_t*>cursor.chunk.buffers[0])[cursor.offset // 8] &
__pyx_t_2 = (((((uint8_t *)(__pyx_v_cursor->chunk->buffers[0]))[(__pyx_v_cursor->offset / 8)]) & (1 << (__pyx_v_cursor->offset % 8))) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L3_bool_binop_done:;
{
__pyx_r = __pyx_t_1;
}
goto __pyx_L0;
3152: (1 << (cursor.offset % 8))
3153: )
3154: )
3155:
3156:
+3157: cdef inline void _dataframe_arrow_get_cat_value(
static CYTHON_INLINE void __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t __pyx_v_key, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int32_t *__pyx_v_value_index_access;
int64_t *__pyx_v_value_lrg_index_access;
int32_t __pyx_v_value_begin;
int64_t __pyx_v_value_lrg_begin;
uint8_t *__pyx_v_value_char_access;
/* … */
/* function exit code */
}
3158: col_cursor_t* cursor,
3159: size_t key,
3160: size_t* len_out,
3161: const char** buf_out) noexcept nogil:
3162: cdef int32_t* value_index_access
3163: cdef int64_t* value_lrg_index_access
3164: cdef int32_t value_begin
3165: cdef int64_t value_lrg_begin
3166: cdef uint8_t* value_char_access
+3167: value_char_access = <uint8_t*>cursor.chunk.dictionary.buffers[2]
__pyx_v_value_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->dictionary->buffers[2]));
+3168: if cursor.dictionary_large_offsets:
if (__pyx_v_cursor->dictionary_large_offsets) {
/* … */
goto __pyx_L3;
}
+3169: value_lrg_index_access = <int64_t*>cursor.chunk.dictionary.buffers[1]
__pyx_v_value_lrg_index_access = ((int64_t *)(__pyx_v_cursor->chunk->dictionary->buffers[1]));
+3170: value_lrg_begin = value_lrg_index_access[key]
__pyx_v_value_lrg_begin = (__pyx_v_value_lrg_index_access[__pyx_v_key]);
+3171: len_out[0] = <size_t>(
(__pyx_v_len_out[0]) = ((size_t)((__pyx_v_value_lrg_index_access[(__pyx_v_key + 1)]) - __pyx_v_value_lrg_begin));
3172: value_lrg_index_access[key + 1] - value_lrg_begin)
+3173: buf_out[0] = <const char*>&value_char_access[
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_value_char_access[((size_t)__pyx_v_value_lrg_begin)])));
3174: <size_t>value_lrg_begin]
3175: else:
+3176: value_index_access = <int32_t*>cursor.chunk.dictionary.buffers[1]
/*else*/ {
__pyx_v_value_index_access = ((int32_t *)(__pyx_v_cursor->chunk->dictionary->buffers[1]));
+3177: value_begin = value_index_access[key]
__pyx_v_value_begin = (__pyx_v_value_index_access[__pyx_v_key]);
+3178: len_out[0] = value_index_access[key + 1] - value_begin
(__pyx_v_len_out[0]) = ((__pyx_v_value_index_access[(__pyx_v_key + 1)]) - __pyx_v_value_begin);
+3179: buf_out[0] = <const char*>&value_char_access[value_begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_value_char_access[__pyx_v_value_begin]))); } __pyx_L3:;
3180:
3181:
+3182: cdef inline bint _dataframe_arrow_get_cat_i8(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int8_t *__pyx_v_key_access;
int8_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3183: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+3184: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
3185: cdef int8_t* key_access
3186: cdef int8_t key
+3187: if valid:
if (__pyx_v_valid) {
/* … */
}
+3188: key_access = <int8_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int8_t *)(__pyx_v_cursor->chunk->buffers[1]));
+3189: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+3190: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+3191: return valid
{
__pyx_r = __pyx_v_valid;
}
goto __pyx_L0;
3192:
3193:
+3194: cdef inline bint _dataframe_arrow_get_cat_i16(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int16_t *__pyx_v_key_access;
int16_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3195: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+3196: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
3197: cdef int16_t* key_access
3198: cdef int16_t key
+3199: if valid:
if (__pyx_v_valid) {
/* … */
}
+3200: key_access = <int16_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int16_t *)(__pyx_v_cursor->chunk->buffers[1]));
+3201: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+3202: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+3203: return valid
{
__pyx_r = __pyx_v_valid;
}
goto __pyx_L0;
3204:
3205:
+3206: cdef inline bint _dataframe_arrow_get_cat_i32(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int __pyx_v_valid;
int32_t *__pyx_v_key_access;
int32_t __pyx_v_key;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3207: col_cursor_t* cursor, size_t* len_out, const char** buf_out) noexcept nogil:
+3208: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
3209: cdef int32_t* key_access
3210: cdef int32_t key
+3211: if valid:
if (__pyx_v_valid) {
/* … */
}
+3212: key_access = <int32_t*>cursor.chunk.buffers[1]
__pyx_v_key_access = ((int32_t *)(__pyx_v_cursor->chunk->buffers[1]));
+3213: key = key_access[cursor.offset]
__pyx_v_key = (__pyx_v_key_access[__pyx_v_cursor->offset]);
+3214: _dataframe_arrow_get_cat_value(cursor, <size_t>key, len_out, buf_out)
__pyx_f_7questdb_7_client__dataframe_arrow_get_cat_value(__pyx_v_cursor, ((size_t)__pyx_v_key), __pyx_v_len_out, __pyx_v_buf_out);
+3215: return valid
{
__pyx_r = __pyx_v_valid;
}
goto __pyx_L0;
3216:
3217:
+3218: cdef inline bint _dataframe_arrow_str_utf8(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int32_t *__pyx_v_index_access;
uint8_t *__pyx_v_char_access;
int32_t __pyx_v_begin;
int __pyx_v_valid;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3219: col_cursor_t* cursor,
3220: size_t* len_out,
3221: const char** buf_out) noexcept nogil:
3222: cdef int32_t* index_access
3223: cdef uint8_t* char_access
3224: cdef int32_t begin
+3225: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
+3226: if valid:
if (__pyx_v_valid) {
/* … */
}
+3227: index_access = <int32_t*>cursor.chunk.buffers[1]
__pyx_v_index_access = ((int32_t *)(__pyx_v_cursor->chunk->buffers[1]));
+3228: char_access = <uint8_t*>cursor.chunk.buffers[2]
__pyx_v_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->buffers[2]));
+3229: begin = index_access[cursor.offset]
__pyx_v_begin = (__pyx_v_index_access[__pyx_v_cursor->offset]);
+3230: len_out[0] = index_access[cursor.offset + 1] - begin
(__pyx_v_len_out[0]) = ((__pyx_v_index_access[(__pyx_v_cursor->offset + 1)]) - __pyx_v_begin);
+3231: buf_out[0] = <const char*>&char_access[begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_char_access[__pyx_v_begin])));
+3232: return valid
{
__pyx_r = __pyx_v_valid;
}
goto __pyx_L0;
3233:
+3234: cdef inline bint _dataframe_arrow_str_utf8_lrg(
static CYTHON_INLINE int __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg(struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, size_t *__pyx_v_len_out, char const **__pyx_v_buf_out) {
int64_t *__pyx_v_index_access;
uint8_t *__pyx_v_char_access;
int64_t __pyx_v_begin;
int __pyx_v_valid;
int __pyx_r;
/* … */
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
3235: col_cursor_t* cursor,
3236: size_t* len_out,
3237: const char** buf_out) noexcept nogil:
3238: cdef int64_t* index_access
3239: cdef uint8_t* char_access
3240: cdef int64_t begin
+3241: cdef bint valid = _dataframe_arrow_is_valid(cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid(__pyx_v_cursor);
+3242: if valid:
if (__pyx_v_valid) {
/* … */
}
+3243: index_access = <int64_t*>cursor.chunk.buffers[1]
__pyx_v_index_access = ((int64_t *)(__pyx_v_cursor->chunk->buffers[1]));
+3244: char_access = <uint8_t*>cursor.chunk.buffers[2]
__pyx_v_char_access = ((uint8_t *)(__pyx_v_cursor->chunk->buffers[2]));
+3245: begin = index_access[cursor.offset]
__pyx_v_begin = (__pyx_v_index_access[__pyx_v_cursor->offset]);
+3246: len_out[0] = index_access[cursor.offset + 1] - begin
(__pyx_v_len_out[0]) = ((__pyx_v_index_access[(__pyx_v_cursor->offset + 1)]) - __pyx_v_begin);
+3247: buf_out[0] = <const char*>&char_access[begin]
(__pyx_v_buf_out[0]) = ((char const *)(&(__pyx_v_char_access[__pyx_v_begin])));
+3248: return valid
{
__pyx_r = __pyx_v_valid;
}
goto __pyx_L0;
3249:
3250:
+3251: cdef inline void_int _dataframe_cell_str_pyobj_to_utf8(
static CYTHON_INLINE __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor, int *__pyx_v_valid_out, struct line_sender_utf8 *__pyx_v_utf8_out) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_6);
__Pyx_AddTraceback("questdb._client._dataframe_cell_str_pyobj_to_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3252: qdb_pystr_buf* b,
3253: col_cursor_t* cursor,
3254: bint* valid_out,
3255: line_sender_utf8* utf8_out) except -1:
+3256: cdef PyObject** access = <PyObject**>cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_cursor->chunk->buffers[1]));
+3257: cdef PyObject* cell = access[cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_cursor->offset]);
+3258: if PyUnicode_CheckExact(cell):
__pyx_t_1 = PyUnicode_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+3259: str_to_utf8(b, cell, utf8_out)
__pyx_t_2 = __pyx_f_7questdb_7_client_str_to_utf8(__pyx_v_b, __pyx_v_cell, __pyx_v_utf8_out); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3259, __pyx_L1_error)
+3260: valid_out[0] = True
(__pyx_v_valid_out[0]) = 1;
+3261: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3262: valid_out[0] = False
(__pyx_v_valid_out[0]) = 0;
3263: else:
+3264: raise ValueError(
/*else*/ {
__pyx_t_4 = NULL;
3265: 'Expected a string, ' +
+3266: f'got an object of type {_fqn(type(<object>cell))}.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_string_got_an_object; __pyx_t_7[1] = __pyx_t_6; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__3; __pyx_t_8 = 42; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]); #endif __pyx_t_9 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_9 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__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(2, 3264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 3264, __pyx_L1_error) } __pyx_L3:;
3267:
3268:
+3269: cdef void_int _dataframe_serialize_cell_table__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3270: line_sender_buffer* ls_buf,
3271: qdb_pystr_buf* b,
3272: col_t* col) except -1:
+3273: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3274: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+3275: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
3276: cdef line_sender_table_name c_table_name
+3277: if not PyUnicode_CheckExact(cell):
__pyx_t_1 = (!PyUnicode_CheckExact(__pyx_v_cell));
if (__pyx_t_1) {
/* … */
}
+3278: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (unlikely(__pyx_t_1)) {
/* … */
}
+3279: raise ValueError('Expected a table name, got a null value')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Expected_a_table_name_got_a_null};
__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(2, 3279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3279, __pyx_L1_error)
3280: else:
+3281: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
3282: 'Expected a table name (str object), ' +
+3283: f'got an object of type {_fqn(type(<object>cell))}.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyUnicode_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_table_name_str_object; __pyx_t_7[1] = __pyx_t_6; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__3; __pyx_t_8 = 59; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]); #endif __pyx_t_9 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_9 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]); #endif __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = 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_4, (2-__pyx_t_4) | (__pyx_t_4*__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(2, 3281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3281, __pyx_L1_error) }
+3284: str_to_table_name(b, cell, &c_table_name)
__pyx_t_10 = __pyx_f_7questdb_7_client_str_to_table_name(__pyx_v_b, __pyx_v_cell, (&__pyx_v_c_table_name)); if (unlikely(__pyx_t_10 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3284, __pyx_L1_error)
+3285: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3286: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3286, __pyx_L1_error)
3287:
3288:
+3289: cdef void_int _dataframe_serialize_cell_table__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3290: line_sender_buffer* ls_buf,
3291: qdb_pystr_buf* b,
3292: col_t* col,
3293: PyThreadState** gs) except -1:
+3294: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3295: cdef size_t c_len
3296: cdef const char* buf
3297: cdef line_sender_table_name c_table_name
+3298: if _dataframe_arrow_str_utf8(&col.cursor, &c_len, &buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3299: if not line_sender_table_name_init(&c_table_name, c_len, buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3300: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3301: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3301, __pyx_L1_error)
+3302: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3303: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3304: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3304, __pyx_L1_error)
3305: else:
+3306: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3307: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__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(2, 3307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3307, __pyx_L1_error)
}
__pyx_L3:;
3308:
+3309: cdef void_int _dataframe_serialize_cell_table__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3310: line_sender_buffer* ls_buf,
3311: qdb_pystr_buf* b,
3312: col_t* col,
3313: PyThreadState** gs) except -1:
+3314: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3315: cdef size_t c_len
3316: cdef const char* buf
3317: cdef line_sender_table_name c_table_name
+3318: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &c_len, &buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3319: if not line_sender_table_name_init(&c_table_name, c_len, buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3320: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3321: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3321, __pyx_L1_error)
+3322: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3323: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3324: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3324, __pyx_L1_error)
3325: else:
+3326: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3327: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__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(2, 3327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3327, __pyx_L1_error)
}
__pyx_L3:;
3328:
3329:
+3330: cdef void_int _dataframe_serialize_cell_table__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3331: line_sender_buffer* ls_buf,
3332: qdb_pystr_buf* b,
3333: col_t* col,
3334: PyThreadState** gs) except -1:
+3335: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3336: cdef size_t c_len
3337: cdef const char* c_buf
3338: cdef line_sender_table_name c_table_name
+3339: if _dataframe_arrow_get_cat_i8(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3340: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3341: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3342: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3342, __pyx_L1_error)
+3343: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3344: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3345: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3345, __pyx_L1_error)
3346: else:
+3347: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3348: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__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(2, 3348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3348, __pyx_L1_error)
}
__pyx_L3:;
3349:
3350:
+3351: cdef void_int _dataframe_serialize_cell_table__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3352: line_sender_buffer* ls_buf,
3353: qdb_pystr_buf* b,
3354: col_t* col,
3355: PyThreadState** gs) except -1:
+3356: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3357: cdef size_t c_len
3358: cdef const char* c_buf
3359: cdef line_sender_table_name c_table_name
+3360: if _dataframe_arrow_get_cat_i16(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3361: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3362: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3363: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3363, __pyx_L1_error)
+3364: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3365: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3366: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3366, __pyx_L1_error)
3367: else:
+3368: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3369: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__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(2, 3369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3369, __pyx_L1_error)
}
__pyx_L3:;
3370:
3371:
+3372: cdef void_int _dataframe_serialize_cell_table__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_c_len;
char const *__pyx_v_c_buf;
struct line_sender_table_name __pyx_v_c_table_name;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_table__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3373: line_sender_buffer* ls_buf,
3374: qdb_pystr_buf* b,
3375: col_t* col,
3376: PyThreadState** gs) except -1:
+3377: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3378: cdef size_t c_len
3379: cdef const char* c_buf
3380: cdef line_sender_table_name c_table_name
+3381: if _dataframe_arrow_get_cat_i32(&col.cursor, &c_len, &c_buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_c_len), (&__pyx_v_c_buf));
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3382: if not line_sender_table_name_init(&c_table_name, c_len, c_buf, &err):
__pyx_t_1 = (!line_sender_table_name_init((&__pyx_v_c_table_name), __pyx_v_c_len, __pyx_v_c_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3383: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3384: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3384, __pyx_L1_error)
+3385: if not line_sender_buffer_table(ls_buf, c_table_name, &err):
__pyx_t_1 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3386: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3387: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3387, __pyx_L1_error)
3388: else:
+3389: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3390: raise ValueError('Table name cannot be null')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Table_name_cannot_be_null};
__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(2, 3390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3390, __pyx_L1_error)
}
__pyx_L3:;
3391:
3392:
+3393: cdef void_int _dataframe_serialize_cell_symbol__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3394: line_sender_buffer* ls_buf,
3395: qdb_pystr_buf* b,
3396: col_t* col) except -1:
+3397: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3398: cdef bint valid = False
__pyx_v_valid = 0;
3399: cdef line_sender_utf8 utf8
+3400: _dataframe_cell_str_pyobj_to_utf8(b, &col.cursor, &valid, &utf8)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(__pyx_v_b, (&__pyx_v_col->cursor), (&__pyx_v_valid), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3400, __pyx_L1_error)
+3401: if valid and not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
if (__pyx_v_valid) {
} else {
__pyx_t_2 = __pyx_v_valid;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* … */
}
+3402: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 3402, __pyx_L1_error)
3403:
3404:
+3405: cdef void_int _dataframe_serialize_cell_symbol__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3406: line_sender_buffer* ls_buf,
3407: qdb_pystr_buf* b,
3408: col_t* col,
3409: PyThreadState** gs) except -1:
+3410: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3411: cdef line_sender_utf8 utf8
+3412: if _dataframe_arrow_str_utf8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3413: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3414: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3415: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3415, __pyx_L1_error)
3416:
+3417: cdef void_int _dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3418: line_sender_buffer* ls_buf,
3419: qdb_pystr_buf* b,
3420: col_t* col,
3421: PyThreadState** gs) except -1:
+3422: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3423: cdef line_sender_utf8 utf8
+3424: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3425: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3426: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3427: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3427, __pyx_L1_error)
3428:
3429:
+3430: cdef void_int _dataframe_serialize_cell_symbol__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3431: line_sender_buffer* ls_buf,
3432: qdb_pystr_buf* b,
3433: col_t* col,
3434: PyThreadState** gs) except -1:
+3435: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3436: cdef line_sender_utf8 utf8
+3437: if _dataframe_arrow_get_cat_i8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3438: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3439: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3440: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3440, __pyx_L1_error)
3441:
3442:
+3443: cdef void_int _dataframe_serialize_cell_symbol__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3444: line_sender_buffer* ls_buf,
3445: qdb_pystr_buf* b,
3446: col_t* col,
3447: PyThreadState** gs) except -1:
+3448: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3449: cdef line_sender_utf8 utf8
+3450: if _dataframe_arrow_get_cat_i16(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3451: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3452: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3453: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3453, __pyx_L1_error)
3454:
3455:
+3456: cdef void_int _dataframe_serialize_cell_symbol__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_symbol__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3457: line_sender_buffer* ls_buf,
3458: qdb_pystr_buf* b,
3459: col_t* col,
3460: PyThreadState** gs) except -1:
+3461: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3462: cdef line_sender_utf8 utf8
+3463: if _dataframe_arrow_get_cat_i32(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3464: if not line_sender_buffer_symbol(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_symbol(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3465: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3466: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3466, __pyx_L1_error)
3467:
3468:
+3469: cdef void_int _dataframe_serialize_cell_column_bool__bool_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3470: line_sender_buffer* ls_buf,
3471: qdb_pystr_buf* b,
3472: col_t* col) except -1:
+3473: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3474: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+3475: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3476: if PyBool_Check(cell):
__pyx_t_1 = PyBool_Check(__pyx_v_cell);
if (likely(__pyx_t_1)) {
/* … */
goto __pyx_L3;
}
+3477: if not line_sender_buffer_column_bool(
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_cell == Py_True), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3478: ls_buf, col.name, cell == Py_True, &err):
+3479: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3479, __pyx_L1_error)
+3480: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (unlikely(__pyx_t_1)) {
/* … */
}
+3481: raise ValueError('Cannot insert null values into a boolean column.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_insert_null_values_into_a};
__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(2, 3481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3481, __pyx_L1_error)
3482: else:
+3483: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
+3484: 'Expected an object of type bool, got a ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_bool, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+3485: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_4 = 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_4, (2-__pyx_t_4) | (__pyx_t_4*__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(2, 3483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3483, __pyx_L1_error) } __pyx_L3:;
3486:
3487:
+3488: cdef void_int _dataframe_serialize_cell_column_bool__bool_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint8_t *__pyx_v_access;
uint8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3489: line_sender_buffer* ls_buf,
3490: qdb_pystr_buf* b,
3491: col_t* col,
3492: PyThreadState** gs) except -1:
+3493: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3494: cdef uint8_t* access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3495: cdef uint8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3496: if not line_sender_buffer_column_bool(ls_buf, col.name, not not cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, (!(!(__pyx_v_cell != 0))), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3497: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3498: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3498, __pyx_L1_error)
3499:
3500:
+3501: cdef void_int _dataframe_serialize_cell_column_bool__bool_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_bool__bool_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3502: line_sender_buffer* ls_buf,
3503: qdb_pystr_buf* b,
3504: col_t* col,
3505: PyThreadState** gs) except -1:
+3506: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3507: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3508: cdef bint value
+3509: if valid:
if (likely(__pyx_v_valid)) {
/* … */
goto __pyx_L3;
}
+3510: value = _dataframe_arrow_get_bool(&col.cursor)
__pyx_v_value = __pyx_f_7questdb_7_client__dataframe_arrow_get_bool((&__pyx_v_col->cursor));
+3511: if not line_sender_buffer_column_bool(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_bool(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3512: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3513: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3513, __pyx_L1_error)
3514: else:
+3515: _ensure_has_gil(gs)
/*else*/ {
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3516: raise ValueError('Cannot insert null values into a boolean column.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_insert_null_values_into_a};
__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(2, 3516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3516, __pyx_L1_error)
}
__pyx_L3:;
3517:
3518:
+3519: cdef void_int _dataframe_serialize_cell_column_i64__int_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__int_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
int64_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__int_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3520: line_sender_buffer* ls_buf,
3521: qdb_pystr_buf* b,
3522: col_t* col) except -1:
+3523: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3524: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+3525: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
3526: cdef int64_t value
+3527: if PyLong_CheckExact(cell):
__pyx_t_1 = PyLong_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+3528: value = PyLong_AsLongLong(cell)
__pyx_t_2 = PyLong_AsLongLong(__pyx_v_cell); if (unlikely(__pyx_t_2 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(2, 3528, __pyx_L1_error) __pyx_v_value = __pyx_t_2;
+3529: if not line_sender_buffer_column_i64(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3530: raise c_err_to_py(err)
__pyx_t_3 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 3530, __pyx_L1_error)
+3531: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
goto __pyx_L3;
}
3532: pass
3533: else:
+3534: raise ValueError(
/*else*/ {
__pyx_t_4 = NULL;
+3535: 'Expected an object of type int, got an object of type ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_int_g, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 3535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+3536: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 3534, __pyx_L1_error) } __pyx_L3:;
3537:
3538:
+3539: cdef void_int _dataframe_serialize_cell_column_i64__u8_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint8_t *__pyx_v_access;
uint8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u8_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3540: line_sender_buffer* ls_buf,
3541: qdb_pystr_buf* b,
3542: col_t* col,
3543: PyThreadState** gs) except -1:
+3544: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3545: cdef uint8_t* access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3546: cdef uint8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3547: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3548: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3549: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3549, __pyx_L1_error)
3550:
3551:
+3552: cdef void_int _dataframe_serialize_cell_column_i64__i8_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int8_t *__pyx_v_access;
int8_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i8_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3553: line_sender_buffer* ls_buf,
3554: qdb_pystr_buf* b,
3555: col_t* col,
3556: PyThreadState** gs) except -1:
+3557: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3558: cdef int8_t* access = <int8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3559: cdef int8_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3560: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3561: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3562: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3562, __pyx_L1_error)
3563:
3564:
+3565: cdef void_int _dataframe_serialize_cell_column_i64__u16_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint16_t *__pyx_v_access;
uint16_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u16_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3566: line_sender_buffer* ls_buf,
3567: qdb_pystr_buf* b,
3568: col_t* col,
3569: PyThreadState** gs) except -1:
+3570: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3571: cdef uint16_t* access = <uint16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3572: cdef uint16_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3573: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3574: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3575: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3575, __pyx_L1_error)
3576:
3577:
+3578: cdef void_int _dataframe_serialize_cell_column_i64__i16_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int16_t *__pyx_v_access;
int16_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i16_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3579: line_sender_buffer* ls_buf,
3580: qdb_pystr_buf* b,
3581: col_t* col,
3582: PyThreadState** gs) except -1:
+3583: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3584: cdef int16_t* access = <int16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3585: cdef int16_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3586: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3587: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3588: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3588, __pyx_L1_error)
3589:
3590:
+3591: cdef void_int _dataframe_serialize_cell_column_i64__u32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint32_t *__pyx_v_access;
uint32_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3592: line_sender_buffer* ls_buf,
3593: qdb_pystr_buf* b,
3594: col_t* col,
3595: PyThreadState** gs) except -1:
+3596: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3597: cdef uint32_t* access = <uint32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3598: cdef uint32_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3599: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3600: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3601: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3601, __pyx_L1_error)
3602:
3603:
+3604: cdef void_int _dataframe_serialize_cell_column_i64__i32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int32_t *__pyx_v_access;
int32_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3605: line_sender_buffer* ls_buf,
3606: qdb_pystr_buf* b,
3607: col_t* col,
3608: PyThreadState** gs) except -1:
+3609: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3610: cdef int32_t* access = <int32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3611: cdef int32_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3612: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3613: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3614: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3614, __pyx_L1_error)
3615:
3616:
+3617: cdef void_int _dataframe_serialize_cell_column_i64__u64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
uint64_t *__pyx_v_access;
uint64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3618: line_sender_buffer* ls_buf,
3619: qdb_pystr_buf* b,
3620: col_t* col,
3621: PyThreadState** gs) except -1:
+3622: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3623: cdef uint64_t* access = <uint64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3624: cdef uint64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3625: if cell > <uint64_t>INT64_MAX:
__pyx_t_1 = (__pyx_v_cell > ((uint64_t)INT64_MAX));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3626: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3627: raise OverflowError('uint64 value too large for int64 column type.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_uint64_value_too_large_for_int64};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __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(2, 3627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3627, __pyx_L1_error)
+3628: if not line_sender_buffer_column_i64(ls_buf, col.name, <int64_t>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3629: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3630: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3630, __pyx_L1_error)
3631:
3632:
+3633: cdef void_int _dataframe_serialize_cell_column_i64__i64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3634: line_sender_buffer* ls_buf,
3635: qdb_pystr_buf* b,
3636: col_t* col,
3637: PyThreadState** gs) except -1:
+3638: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3639: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3640: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3641: if not line_sender_buffer_column_i64(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3642: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3643: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3643, __pyx_L1_error)
3644:
3645:
+3646: cdef void_int _dataframe_serialize_cell_column_i64__u8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint8_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3647: line_sender_buffer* ls_buf,
3648: qdb_pystr_buf* b,
3649: col_t* col,
3650: PyThreadState** gs) except -1:
+3651: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3652: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3653: cdef uint8_t* access
+3654: if valid:
if (__pyx_v_valid) {
/* … */
}
+3655: access = <uint8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3656: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3657: ls_buf,
3658: col.name,
3659: <int64_t>access[col.cursor.offset],
3660: &err):
+3661: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3662: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3662, __pyx_L1_error)
3663:
3664:
+3665: cdef void_int _dataframe_serialize_cell_column_i64__i8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int8_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3666: line_sender_buffer* ls_buf,
3667: qdb_pystr_buf* b,
3668: col_t* col,
3669: PyThreadState** gs) except -1:
+3670: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3671: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3672: cdef int8_t* access
+3673: if valid:
if (__pyx_v_valid) {
/* … */
}
+3674: access = <int8_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int8_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3675: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3676: ls_buf,
3677: col.name,
3678: <int64_t>access[col.cursor.offset],
3679: &err):
+3680: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3681: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3681, __pyx_L1_error)
3682:
3683:
+3684: cdef void_int _dataframe_serialize_cell_column_i64__u16_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint16_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u16_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3685: line_sender_buffer* ls_buf,
3686: qdb_pystr_buf* b,
3687: col_t* col,
3688: PyThreadState** gs) except -1:
+3689: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3690: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3691: cdef uint16_t* access
+3692: if valid:
if (__pyx_v_valid) {
/* … */
}
+3693: access = <uint16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3694: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3695: ls_buf,
3696: col.name,
3697: <int64_t>access[col.cursor.offset],
3698: &err):
+3699: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3700: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3700, __pyx_L1_error)
3701:
3702:
+3703: cdef void_int _dataframe_serialize_cell_column_i64__i16_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int16_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i16_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3704: line_sender_buffer* ls_buf,
3705: qdb_pystr_buf* b,
3706: col_t* col,
3707: PyThreadState** gs) except -1:
+3708: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3709: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3710: cdef int16_t* access
+3711: if valid:
if (__pyx_v_valid) {
/* … */
}
+3712: access = <int16_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int16_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3713: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3714: ls_buf,
3715: col.name,
3716: <int64_t>access[col.cursor.offset],
3717: &err):
+3718: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3719: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3719, __pyx_L1_error)
3720:
3721:
+3722: cdef void_int _dataframe_serialize_cell_column_i64__u32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint32_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3723: line_sender_buffer* ls_buf,
3724: qdb_pystr_buf* b,
3725: col_t* col,
3726: PyThreadState** gs) except -1:
+3727: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3728: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3729: cdef uint32_t* access
+3730: if valid:
if (__pyx_v_valid) {
/* … */
}
+3731: access = <uint32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3732: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3733: ls_buf,
3734: col.name,
3735: <int64_t>access[col.cursor.offset],
3736: &err):
+3737: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3738: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3738, __pyx_L1_error)
3739:
3740:
+3741: cdef void_int _dataframe_serialize_cell_column_i64__i32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int32_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3742: line_sender_buffer* ls_buf,
3743: qdb_pystr_buf* b,
3744: col_t* col,
3745: PyThreadState** gs) except -1:
+3746: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3747: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3748: cdef int32_t* access
+3749: if valid:
if (__pyx_v_valid) {
/* … */
}
+3750: access = <int32_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int32_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3751: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3752: ls_buf,
3753: col.name,
3754: <int64_t>access[col.cursor.offset],
3755: &err):
+3756: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3757: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3757, __pyx_L1_error)
3758:
3759:
+3760: cdef void_int _dataframe_serialize_cell_column_i64__u64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_access;
uint64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__u64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3761: line_sender_buffer* ls_buf,
3762: qdb_pystr_buf* b,
3763: col_t* col,
3764: PyThreadState** gs) except -1:
+3765: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3766: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3767: cdef uint64_t* access
3768: cdef uint64_t cell
+3769: if valid:
if (__pyx_v_valid) {
/* … */
}
+3770: access = <uint64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3771: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3772: if cell > <uint64_t>INT64_MAX:
__pyx_t_1 = (__pyx_v_cell > ((uint64_t)INT64_MAX));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3773: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3774: raise OverflowError('uint64 value too large for int64 column type.')
__pyx_t_3 = NULL;
__pyx_t_4 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_uint64_value_too_large_for_int64};
__pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __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(2, 3774, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 3774, __pyx_L1_error)
+3775: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, ((int64_t)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3776: ls_buf,
3777: col.name,
3778: <int64_t>cell,
3779: &err):
+3780: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3781: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3781, __pyx_L1_error)
3782:
3783:
+3784: cdef void_int _dataframe_serialize_cell_column_i64__i64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_i64__i64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3785: line_sender_buffer* ls_buf,
3786: qdb_pystr_buf* b,
3787: col_t* col,
3788: PyThreadState** gs) except -1:
+3789: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3790: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3791: cdef int64_t* access
+3792: if valid:
if (__pyx_v_valid) {
/* … */
}
+3793: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3794: if not line_sender_buffer_column_i64(
__pyx_t_1 = (!line_sender_buffer_column_i64(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_access[__pyx_v_col->cursor.offset]), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3795: ls_buf,
3796: col.name,
3797: access[col.cursor.offset],
3798: &err):
+3799: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3800: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3800, __pyx_L1_error)
3801:
3802:
+3803: cdef void_int _dataframe_serialize_cell_column_f64__float_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__float_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
double __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__float_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3804: line_sender_buffer* ls_buf,
3805: qdb_pystr_buf* b,
3806: col_t* col) except -1:
+3807: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3808: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+3809: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
3810: cdef double value
+3811: if PyFloat_CheckExact(cell):
__pyx_t_1 = PyFloat_CheckExact(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+3812: value = PyFloat_AS_DOUBLE(cell)
__pyx_v_value = PyFloat_AS_DOUBLE(__pyx_v_cell);
+3813: if not line_sender_buffer_column_f64(ls_buf, col.name, value, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3814: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3814, __pyx_L1_error)
+3815: elif _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (likely(__pyx_t_1)) {
goto __pyx_L3;
}
3816: pass
3817: else:
+3818: raise ValueError(
/*else*/ {
__pyx_t_3 = NULL;
+3819: 'Expected an object of type float, got an object of type ' +
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_float, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+3820: _fqn(type(<object>cell)) + '.')
__pyx_t_4 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __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_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3818, __pyx_L1_error) } __pyx_L3:;
3821:
3822:
+3823: cdef void_int _dataframe_serialize_cell_column_f64__f32_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
float *__pyx_v_access;
float __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f32_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3824: line_sender_buffer* ls_buf,
3825: qdb_pystr_buf* b,
3826: col_t* col,
3827: PyThreadState** gs) except -1:
+3828: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3829: # Note: This is the C `float` type, not the Python `float` type.
+3830: cdef float* access = <float*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((float *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3831: cdef float cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3832: if not line_sender_buffer_column_f64(ls_buf, col.name, <double>cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, ((double)__pyx_v_cell), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3833: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3834: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3834, __pyx_L1_error)
3835:
3836:
+3837: cdef void_int _dataframe_serialize_cell_column_f64__f64_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
double *__pyx_v_access;
double __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f64_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3838: line_sender_buffer* ls_buf,
3839: qdb_pystr_buf* b,
3840: col_t* col,
3841: PyThreadState** gs) except -1:
+3842: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3843: cdef double* access = <double*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((double *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3844: cdef double cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3845: if not line_sender_buffer_column_f64(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3846: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3847: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3847, __pyx_L1_error)
3848:
3849:
+3850: cdef void_int _dataframe_serialize_cell_column_f64__f32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
float *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3851: line_sender_buffer* ls_buf,
3852: qdb_pystr_buf* b,
3853: col_t* col,
3854: PyThreadState** gs) except -1:
+3855: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3856: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3857: cdef float* access
+3858: if valid:
if (__pyx_v_valid) {
/* … */
}
+3859: access = <float*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((float *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3860: if not line_sender_buffer_column_f64(
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, ((double)(__pyx_v_access[__pyx_v_col->cursor.offset])), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3861: ls_buf,
3862: col.name,
3863: <double>access[col.cursor.offset],
3864: &err):
+3865: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3866: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3866, __pyx_L1_error)
3867:
3868:
+3869: cdef void_int _dataframe_serialize_cell_column_f64__f64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
double *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_f64__f64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3870: line_sender_buffer* ls_buf,
3871: qdb_pystr_buf* b,
3872: col_t* col,
3873: PyThreadState** gs) except -1:
+3874: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3875: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
3876: cdef double* access
+3877: if valid:
if (__pyx_v_valid) {
/* … */
}
+3878: access = <double*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((double *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3879: if not line_sender_buffer_column_f64(
__pyx_t_1 = (!line_sender_buffer_column_f64(__pyx_v_ls_buf, __pyx_v_col->name, (__pyx_v_access[__pyx_v_col->cursor.offset]), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
3880: ls_buf,
3881: col.name,
3882: access[col.cursor.offset],
3883: &err):
+3884: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3885: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3885, __pyx_L1_error)
3886:
3887:
+3888: cdef void_int _dataframe_serialize_cell_column_str__str_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3889: line_sender_buffer* ls_buf,
3890: qdb_pystr_buf* b,
3891: col_t* col) except -1:
+3892: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3893: cdef bint valid = False
__pyx_v_valid = 0;
3894: cdef line_sender_utf8 utf8
+3895: _dataframe_cell_str_pyobj_to_utf8(b, &col.cursor, &valid, &utf8)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_cell_str_pyobj_to_utf8(__pyx_v_b, (&__pyx_v_col->cursor), (&__pyx_v_valid), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 3895, __pyx_L1_error)
+3896: if valid and not line_sender_buffer_column_str(
if (__pyx_v_valid) {
} else {
__pyx_t_2 = __pyx_v_valid;
goto __pyx_L4_bool_binop_done;
}
/* … */
__pyx_t_3 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
/* … */
if (unlikely(__pyx_t_2)) {
/* … */
}
3897: ls_buf, col.name, utf8, &err):
+3898: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 3898, __pyx_L1_error)
3899:
3900:
+3901: cdef void_int _dataframe_serialize_cell_column_str__str_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3902: line_sender_buffer* ls_buf,
3903: qdb_pystr_buf* b,
3904: col_t* col,
3905: PyThreadState** gs) except -1:
+3906: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3907: cdef line_sender_utf8 utf8
+3908: if _dataframe_arrow_str_utf8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3909: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3910: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3911: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3911, __pyx_L1_error)
3912:
+3913: cdef void_int _dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_lrg_utf8_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3914: line_sender_buffer* ls_buf,
3915: qdb_pystr_buf* b,
3916: col_t* col,
3917: PyThreadState** gs) except -1:
+3918: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3919: cdef line_sender_utf8 utf8
+3920: if _dataframe_arrow_str_utf8_lrg(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_str_utf8_lrg((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3921: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3922: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3923: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3923, __pyx_L1_error)
3924:
3925:
+3926: cdef void_int _dataframe_serialize_cell_column_str__str_i8_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i8_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i8_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3927: line_sender_buffer* ls_buf,
3928: qdb_pystr_buf* b,
3929: col_t* col,
3930: PyThreadState** gs) except -1:
+3931: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3932: cdef line_sender_utf8 utf8
+3933: if _dataframe_arrow_get_cat_i8(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i8((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3934: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3935: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3936: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3936, __pyx_L1_error)
3937:
3938:
+3939: cdef void_int _dataframe_serialize_cell_column_str__str_i16_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i16_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i16_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3940: line_sender_buffer* ls_buf,
3941: qdb_pystr_buf* b,
3942: col_t* col,
3943: PyThreadState** gs) except -1:
+3944: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3945: cdef line_sender_utf8 utf8
+3946: if _dataframe_arrow_get_cat_i16(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i16((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3947: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3948: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3949: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3949, __pyx_L1_error)
3950:
3951:
+3952: cdef void_int _dataframe_serialize_cell_column_str__str_i32_cat(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i32_cat(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
struct line_sender_utf8 __pyx_v_utf8;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_str__str_i32_cat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3953: line_sender_buffer* ls_buf,
3954: qdb_pystr_buf* b,
3955: col_t* col,
3956: PyThreadState** gs) except -1:
+3957: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
3958: cdef line_sender_utf8 utf8
+3959: if _dataframe_arrow_get_cat_i32(&col.cursor, &utf8.len, &utf8.buf):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_arrow_get_cat_i32((&__pyx_v_col->cursor), (&__pyx_v_utf8.len), (&__pyx_v_utf8.buf));
if (__pyx_t_1) {
/* … */
}
+3960: if not line_sender_buffer_column_str(ls_buf, col.name, utf8, &err):
__pyx_t_1 = (!line_sender_buffer_column_str(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_utf8, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3961: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3962: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3962, __pyx_L1_error)
3963:
3964:
+3965: cdef void_int _dataframe_serialize_cell_column_ts__dt64ns_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64ns_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3966: line_sender_buffer* ls_buf,
3967: qdb_pystr_buf* b,
3968: col_t* col,
3969: PyThreadState** gs) except -1:
+3970: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3971: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3972: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3973: if cell != _NAT:
__pyx_t_1 = (__pyx_v_cell != __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
}
+3974: if not line_sender_buffer_column_ts_nanos(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_nanos(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3975: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3976: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3976, __pyx_L1_error)
3977:
3978:
+3979: cdef void_int _dataframe_serialize_cell_column_ts__dt64us_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64us_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3980: line_sender_buffer* ls_buf,
3981: qdb_pystr_buf* b,
3982: col_t* col,
3983: PyThreadState** gs) except -1:
+3984: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3985: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+3986: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+3987: if cell != _NAT:
__pyx_t_1 = (__pyx_v_cell != __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
}
+3988: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+3989: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+3990: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 3990, __pyx_L1_error)
3991:
3992:
+3993: cdef void_int _dataframe_serialize_cell_column_ts__datetime_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__datetime_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct line_sender_error *__pyx_v_err;
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
PyObject *__pyx_v_dt = 0;
PyObject *__pyx_v_delta = 0;
int64_t __pyx_v_micros;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__datetime_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dt);
__Pyx_XDECREF(__pyx_v_delta);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
3994: line_sender_buffer* ls_buf,
3995: qdb_pystr_buf* b,
3996: col_t* col) except -1:
+3997: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+3998: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+3999: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
4000: cdef object dt
4001: cdef object delta
4002: cdef int64_t micros
+4003: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+4004: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+4005: if not isinstance(<object>cell, cp_datetime):
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_cell), __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime);
__pyx_t_2 = (!__pyx_t_1);
if (unlikely(__pyx_t_2)) {
/* … */
}
+4006: raise ValueError(
__pyx_t_4 = NULL;
+4007: 'Expected an object of type datetime, got an object of type ' +
__pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_datet, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+4008: _fqn(type(<object>cell)) + '.')
__pyx_t_5 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* … */ __pyx_t_5 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; __pyx_t_3 = __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_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4006, __pyx_L1_error)
+4009: dt = <object>cell
__pyx_t_3 = ((PyObject *)__pyx_v_cell);
__Pyx_INCREF(__pyx_t_3);
__pyx_v_dt = __pyx_t_3;
__pyx_t_3 = 0;
+4010: if dt.tzinfo is None:
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_mstate_global->__pyx_n_u_tzinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__pyx_t_3 == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* … */ goto __pyx_L5; }
4011: micros = (
4012: _days_from_civil(
4013: PyDateTime_GET_YEAR(dt),
4014: PyDateTime_GET_MONTH(dt),
4015: PyDateTime_GET_DAY(dt)) * <int64_t>86_400_000_000
4016: + <int64_t>PyDateTime_DATE_GET_HOUR(dt) * <int64_t>3_600_000_000
4017: + <int64_t>PyDateTime_DATE_GET_MINUTE(dt) * 60_000_000
4018: + <int64_t>PyDateTime_DATE_GET_SECOND(dt) * 1_000_000
+4019: + <int64_t>PyDateTime_DATE_GET_MICROSECOND(dt))
__pyx_v_micros = (((((__pyx_f_7questdb_7_client__days_from_civil(PyDateTime_GET_YEAR(__pyx_v_dt), PyDateTime_GET_MONTH(__pyx_v_dt), PyDateTime_GET_DAY(__pyx_v_dt)) * ((int64_t)0x141DD76000)) + (((int64_t)PyDateTime_DATE_GET_HOUR(__pyx_v_dt)) * ((int64_t)0xD693A400))) + (((int64_t)PyDateTime_DATE_GET_MINUTE(__pyx_v_dt)) * 0x3938700)) + (((int64_t)PyDateTime_DATE_GET_SECOND(__pyx_v_dt)) * 0xF4240)) + ((int64_t)PyDateTime_DATE_GET_MICROSECOND(__pyx_v_dt)));
4020: else:
+4021: delta = dt - _EPOCH_AWARE_UTC
/*else*/ {
__pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_v_dt, __pyx_v_7questdb_7_client__EPOCH_AWARE_UTC); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4021, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_delta = __pyx_t_3;
__pyx_t_3 = 0;
4022: micros = (
+4023: <int64_t>delta.days * <int64_t>86_400_000_000
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 4023, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+4024: + <int64_t>delta.seconds * 1_000_000
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_seconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 4024, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+4025: + <int64_t>delta.microseconds)
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_delta, __pyx_mstate_global->__pyx_n_u_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyLong_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 4025, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_micros = (((((int64_t)__pyx_t_8) * ((int64_t)0x141DD76000)) + (((int64_t)__pyx_t_9) * 0xF4240)) + ((int64_t)__pyx_t_10)); } __pyx_L5:;
+4026: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, micros, &err):
__pyx_t_2 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_micros, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4027: raise c_err_to_py(err)
__pyx_t_3 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 4027, __pyx_L1_error)
+4028: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
4029:
4030:
+4031: cdef void_int _dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
PyArrayObject *__pyx_v_arr;
npy_int __pyx_v_arr_type;
PyArray_Descr *__pyx_v_arr_descr = 0;
size_t __pyx_v_rank;
double const *__pyx_v_data_ptr;
struct line_sender_error *__pyx_v_err;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_arr_descr);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4032: line_sender_buffer* ls_buf,
4033: qdb_pystr_buf* b,
4034: col_t* col) except -1:
+4035: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+4036: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
4037: cdef PyArrayObject* arr
4038: cdef npy_int arr_type
4039: cdef cnp.dtype arr_descr
+4040: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+4041: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
+4042: if not PyArray_CheckExact(cell):
__pyx_t_1 = (!PyArray_CheckExact(__pyx_v_cell));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4043: raise ValueError(
__pyx_t_3 = NULL;
+4044: 'Expected an object of type numpy.ndarray, got an object of type ' +
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_numpy, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+4045: _fqn(type(<object>cell)) + '.')
__pyx_t_4 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_cell))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __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_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4043, __pyx_L1_error)
+4046: arr = <PyArrayObject*>cell
__pyx_v_arr = ((PyArrayObject *)__pyx_v_cell);
+4047: arr_type = PyArray_TYPE(arr)
__pyx_v_arr_type = PyArray_TYPE(__pyx_v_arr);
+4048: if arr_type != NPY_DOUBLE:
__pyx_t_1 = (__pyx_v_arr_type != NPY_DOUBLE);
if (unlikely(__pyx_t_1)) {
/* … */
}
+4049: arr_descr = cnp.PyArray_DescrFromType(arr_type)
__pyx_t_2 = ((PyObject *)PyArray_DescrFromType(__pyx_v_arr_type)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_arr_descr = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0;
+4050: raise QuestDBError(
__pyx_t_4 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4050, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+4051: QuestDBErrorCode.ArrayError,
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ArrayError); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 4051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+4052: f'Only float64 numpy arrays are supported, got dtype: {arr_descr}')
__pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_arr_descr), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Only_float64_numpy_arrays_are_su, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 4052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 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_6 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__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_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4050, __pyx_L1_error)
4053: cdef:
+4054: size_t rank = PyArray_NDIM(arr)
__pyx_v_rank = PyArray_NDIM(__pyx_v_arr);
+4055: const double* data_ptr = <const double *> PyArray_DATA(arr)
__pyx_v_data_ptr = ((double const *)PyArray_DATA(__pyx_v_arr));
+4056: line_sender_error * err = NULL
__pyx_v_err = NULL;
4057:
+4058: if PyArray_FLAGS(arr) & NPY_ARRAY_C_CONTIGUOUS != 0:
__pyx_t_1 = ((PyArray_FLAGS(__pyx_v_arr) & NPY_ARRAY_C_CONTIGUOUS) != 0);
if (__pyx_t_1) {
/* … */
goto __pyx_L6;
}
+4059: if not line_sender_buffer_column_f64_arr_c_major(
__pyx_t_1 = (!line_sender_buffer_column_f64_arr_c_major(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_rank, ((size_t const *)PyArray_DIMS(__pyx_v_arr)), __pyx_v_data_ptr, PyArray_SIZE(__pyx_v_arr), (&__pyx_v_err))); if (unlikely(__pyx_t_1)) { /* … */ }
4060: ls_buf,
4061: col.name,
4062: rank,
4063: <const size_t *> PyArray_DIMS(arr),
4064: data_ptr,
4065: PyArray_SIZE(arr),
4066: &err):
+4067: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4067, __pyx_L1_error)
4068: else:
+4069: if not line_sender_buffer_column_f64_arr_byte_strides(
/*else*/ {
/* … */
__pyx_t_1 = (!line_sender_buffer_column_f64_arr_byte_strides(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_rank, ((size_t const *)PyArray_DIMS(__pyx_v_arr)), ((Py_ssize_t const *)PyArray_STRIDES(__pyx_v_arr)), __pyx_v_data_ptr, PyArray_SIZE(__pyx_v_arr), (&__pyx_v_err)));
/* … */
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L6:;
4070: ls_buf,
4071: col.name,
4072: rank,
4073: <const size_t*> PyArray_DIMS(arr),
4074: <const ssize_t*> PyArray_STRIDES(arr), # N.B.: Strides expressed as byte jumps
4075: data_ptr,
4076: PyArray_SIZE(arr),
4077: &err):
+4078: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4078, __pyx_L1_error)
4079:
+4080: cdef void_int serialize_decimal_py_obj(line_sender_buffer *buf, line_sender_column_name c_name, PyObject* value) except -1:
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client_serialize_decimal_py_obj(struct line_sender_buffer *__pyx_v_buf, struct line_sender_column_name __pyx_v_c_name, PyObject *__pyx_v_value) {
struct line_sender_error *__pyx_v_err;
unsigned int __pyx_v_scale;
uint8_t __pyx_v_unscaled[32];
int __pyx_v_unscaled_length;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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("questdb._client.serialize_decimal_py_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+4081: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4082: cdef unsigned int scale = 0
__pyx_v_scale = 0;
4083: cdef uint8_t[32] unscaled
4084: cdef int unscaled_length
4085:
+4086: if not _is_decimal(<object>value):
__pyx_t_1 = (!__pyx_f_7questdb_7_client__is_decimal(((PyObject *)__pyx_v_value)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4087: raise ValueError(
__pyx_t_3 = NULL;
+4088: 'Expected an object of type Decimal, got an object of type ' +
__pyx_t_5 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Expected_an_object_of_type_Decim, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+4089: _fqn(type(<object>value)) + '.')
__pyx_t_4 = __pyx_f_7questdb_7_client__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_value))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* … */ __pyx_t_4 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; __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_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4087, __pyx_L1_error)
+4090: if not _DECIMAL_IS_C:
__pyx_t_1 = (!__pyx_v_7questdb_7_client__DECIMAL_IS_C);
if (unlikely(__pyx_t_1)) {
/* … */
}
+4091: raise ValueError(
__pyx_t_4 = NULL;
+4092: f'DECIMAL columns are encoded by reading the memory of a '
__pyx_t_8 = 277;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7[1]);
#endif
__pyx_t_9 = 0;
#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
__pyx_t_9 |= __Pyx_PyUnicode_KIND_04(__pyx_t_7[1]);
#endif
__pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_8, __pyx_t_9);
if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4092, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __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_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4091, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(2, 4091, __pyx_L1_error)
4093: f'`decimal.Decimal` in the layout CPython\'s `_decimal` '
4094: f'accelerator gives it, so they need CPython with that '
4095: f'accelerator present; this interpreter is '
+4096: f'{_PY_IMPL_NAME!r}. Send the value as a float or as a '
__pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_7questdb_7_client__PY_IMPL_NAME), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_DECIMAL_columns_are_encoded_by_r; __pyx_t_7[1] = __pyx_t_3; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_Send_the_value_as_a_float_or_as;
4097: f'string instead, or use a CPython build.')
4098:
+4099: unscaled_length = decimal_pyobj_to_binary(
__pyx_t_9 = __pyx_f_7questdb_16mpdecimal_compat_decimal_pyobj_to_binary(__pyx_v_value, __pyx_v_unscaled, (&__pyx_v_scale), __pyx_t_2, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 4099, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_unscaled_length = __pyx_t_9;
4100: value,
4101: unscaled,
4102: &scale,
+4103: QuestDBError,
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2);
+4104: QuestDBErrorCode.BadDataFrame)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+4105: if unscaled_length == 0:
__pyx_t_1 = (__pyx_v_unscaled_length == 0);
if (__pyx_t_1) {
/* … */
}
+4106: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
4107:
+4108: if not line_sender_buffer_column_dec(buf, c_name, scale, unscaled, <size_t>unscaled_length, &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_buf, __pyx_v_c_name, __pyx_v_scale, __pyx_v_unscaled, ((size_t)__pyx_v_unscaled_length), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4109: raise c_err_to_py(err)
__pyx_t_4 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 4109, __pyx_L1_error)
4110:
+4111: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
4112:
4113:
+4114: cdef void_int _dataframe_serialize_cell_column_decimal__decimal_pyobj(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal_pyobj(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
PyObject **__pyx_v_access;
PyObject *__pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal_pyobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
4115: line_sender_buffer* ls_buf,
4116: qdb_pystr_buf* b,
4117: col_t* col) except -1:
+4118: cdef PyObject** access = <PyObject**>col.cursor.chunk.buffers[1]
__pyx_v_access = ((PyObject **)(__pyx_v_col->cursor.chunk->buffers[1]));
+4119: cdef PyObject* cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
4120:
+4121: if _dataframe_is_null_pyobj(cell):
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_is_null_pyobj(__pyx_v_cell);
if (__pyx_t_1) {
/* … */
}
+4122: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
4123:
+4124: return serialize_decimal_py_obj(ls_buf, col.name, cell)
__pyx_t_2 = __pyx_f_7questdb_7_client_serialize_decimal_py_obj(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4124, __pyx_L1_error)
{
__pyx_r = __pyx_t_2;
}
goto __pyx_L0;
4125:
4126:
+4127: cdef void_int _dataframe_serialize_cell_column_decimal__decimal32_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal32_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint32_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal32_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4128: line_sender_buffer* ls_buf,
4129: qdb_pystr_buf* b,
4130: col_t* col,
4131: PyThreadState** gs) except -1:
+4132: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4133: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4134: cdef uint32_t value
+4135: if valid:
if (__pyx_v_valid) {
/* … */
}
+4136: value = bswap32((<uint32_t*>col.cursor.chunk.buffers[1])[col.cursor.offset])
__pyx_v_value = __pyx_f_7questdb_7_client_bswap32((((uint32_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[__pyx_v_col->cursor.offset]));
+4137: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> &value, sizeof(value), &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)(&__pyx_v_value)), (sizeof(__pyx_v_value)), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4138: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4139: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4139, __pyx_L1_error)
4140:
+4141: cdef void_int _dataframe_serialize_cell_column_decimal__decimal64_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal64_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t __pyx_v_value;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal64_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4142: line_sender_buffer* ls_buf,
4143: qdb_pystr_buf* b,
4144: col_t* col,
4145: PyThreadState** gs) except -1:
+4146: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4147: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4148: cdef uint64_t value
+4149: if valid:
if (__pyx_v_valid) {
/* … */
}
+4150: value = bswap64((<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset])
__pyx_v_value = __pyx_f_7questdb_7_client_bswap64((((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[__pyx_v_col->cursor.offset]));
+4151: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> &value, sizeof(value), &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)(&__pyx_v_value)), (sizeof(__pyx_v_value)), (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4152: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4153: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4153, __pyx_L1_error)
4154:
+4155: cdef void_int _dataframe_serialize_cell_column_decimal__decimal128_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal128_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_cell;
uint64_t __pyx_v_value[2];
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal128_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4156: line_sender_buffer* ls_buf,
4157: qdb_pystr_buf* b,
4158: col_t* col,
4159: PyThreadState** gs) except -1:
+4160: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4161: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4162: cdef uint64_t *cell
4163: cdef uint64_t[2] value
+4164: if valid:
if (__pyx_v_valid) {
/* … */
}
+4165: cell = &(<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset << 1]
__pyx_v_cell = (&(((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[(__pyx_v_col->cursor.offset << 1)]));
+4166: value[0] = bswap64(cell[1])
(__pyx_v_value[0]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[1]));
+4167: value[1] = bswap64(cell[0])
(__pyx_v_value[1]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[0]));
+4168: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> value, 16, &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)__pyx_v_value), 16, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4169: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4170: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4170, __pyx_L1_error)
4171:
+4172: cdef void_int _dataframe_serialize_cell_column_decimal__decimal256_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal256_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
uint64_t *__pyx_v_cell;
uint64_t __pyx_v_value[4];
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_decimal__decimal256_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4173: line_sender_buffer* ls_buf,
4174: qdb_pystr_buf* b,
4175: col_t* col,
4176: PyThreadState** gs) except -1:
+4177: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4178: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4179: cdef uint64_t *cell
4180: cdef uint64_t[4] value
+4181: if valid:
if (__pyx_v_valid) {
/* … */
}
+4182: cell = &(<uint64_t*>col.cursor.chunk.buffers[1])[col.cursor.offset << 2]
__pyx_v_cell = (&(((uint64_t *)(__pyx_v_col->cursor.chunk->buffers[1]))[(__pyx_v_col->cursor.offset << 2)]));
+4183: value[0] = bswap64(cell[3])
(__pyx_v_value[0]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[3]));
+4184: value[1] = bswap64(cell[2])
(__pyx_v_value[1]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[2]));
+4185: value[2] = bswap64(cell[1])
(__pyx_v_value[2]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[1]));
+4186: value[3] = bswap64(cell[0])
(__pyx_v_value[3]) = __pyx_f_7questdb_7_client_bswap64((__pyx_v_cell[0]));
+4187: if not line_sender_buffer_column_dec(ls_buf, col.name, col.scale, <uint8_t *> value, 32, &err):
__pyx_t_1 = (!line_sender_buffer_column_dec(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_col->scale, ((uint8_t *)__pyx_v_value), 32, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4188: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4189: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4189, __pyx_L1_error)
4190:
4191:
+4192: cdef void_int _dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t __pyx_v_cell;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64ns_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4193: line_sender_buffer* ls_buf,
4194: qdb_pystr_buf* b,
4195: col_t* col,
4196: PyThreadState** gs) except -1:
+4197: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4198: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4199: cdef int64_t cell
4200: cdef int64_t* access
+4201: if valid:
if (__pyx_v_valid) {
/* … */
}
+4202: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4203: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+4204: if not line_sender_buffer_column_ts_nanos(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_nanos(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4205: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4206: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4206, __pyx_L1_error)
4207:
4208:
+4209: cdef void_int _dataframe_serialize_cell_column_ts__dt64us_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t __pyx_v_cell;
int64_t *__pyx_v_access;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_column_ts__dt64us_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4210: line_sender_buffer* ls_buf,
4211: qdb_pystr_buf* b,
4212: col_t* col,
4213: PyThreadState** gs) except -1:
+4214: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4215: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4216: cdef int64_t cell
4217: cdef int64_t* access
+4218: if valid:
if (__pyx_v_valid) {
/* … */
}
+4219: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4220: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+4221: if not line_sender_buffer_column_ts_micros(ls_buf, col.name, cell, &err):
__pyx_t_1 = (!line_sender_buffer_column_ts_micros(__pyx_v_ls_buf, __pyx_v_col->name, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4222: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4223: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4223, __pyx_L1_error)
4224:
4225:
+4226: cdef void_int _dataframe_serialize_cell_at_dt64ns_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64ns_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4227: line_sender_buffer* ls_buf,
4228: qdb_pystr_buf* b,
4229: col_t* col,
4230: PyThreadState** gs) except -1:
+4231: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4232: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4233: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+4234: if cell == _NAT:
__pyx_t_1 = (__pyx_v_cell == __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+4235: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4236: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4237: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4237, __pyx_L1_error)
4238: else:
4239: # Note: ls_buf will validate against negative numbers.
+4240: if not line_sender_buffer_at_nanos(ls_buf, cell, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+4241: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4242: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4242, __pyx_L1_error)
4243:
4244:
+4245: cdef void_int _dataframe_serialize_cell_at_dt64us_numpy(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_numpy(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64us_numpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4246: line_sender_buffer* ls_buf,
4247: qdb_pystr_buf* b,
4248: col_t* col,
4249: PyThreadState** gs) except -1:
+4250: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4251: cdef int64_t* access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4252: cdef int64_t cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
+4253: if cell == _NAT:
__pyx_t_1 = (__pyx_v_cell == __pyx_v_7questdb_7_client__NAT);
if (__pyx_t_1) {
/* … */
goto __pyx_L3;
}
+4254: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4255: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4256: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4256, __pyx_L1_error)
4257: else:
4258: # Note: ls_buf will validate against negative numbers.
+4259: if not line_sender_buffer_at_micros(ls_buf, cell, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_micros(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+4260: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4261: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4261, __pyx_L1_error)
4262:
4263:
+4264: cdef void_int _dataframe_serialize_cell_at_dt64ns_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64ns_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4265: line_sender_buffer* ls_buf,
4266: qdb_pystr_buf* b,
4267: col_t* col,
4268: PyThreadState** gs) except -1:
+4269: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4270: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4271: cdef int64_t* access
4272: cdef int64_t cell
+4273: if valid:
if (__pyx_v_valid) {
/* … */
goto __pyx_L3;
}
+4274: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4275: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
4276: # Note: ls_buf will validate against negative numbers.
+4277: if not line_sender_buffer_at_nanos(ls_buf, cell, &err):
__pyx_t_1 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4278: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4279: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4279, __pyx_L1_error)
4280: else:
+4281: if not line_sender_buffer_at_now(ls_buf, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+4282: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4283: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4283, __pyx_L1_error)
4284:
4285:
+4286: cdef void_int _dataframe_serialize_cell_at_dt64us_tz_arrow(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_tz_arrow(struct line_sender_buffer *__pyx_v_ls_buf, CYTHON_UNUSED struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_err;
int __pyx_v_valid;
int64_t *__pyx_v_access;
int64_t __pyx_v_cell;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell_at_dt64us_tz_arrow", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4287: line_sender_buffer* ls_buf,
4288: qdb_pystr_buf* b,
4289: col_t* col,
4290: PyThreadState** gs) except -1:
+4291: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
+4292: cdef bint valid = _dataframe_arrow_is_valid(&col.cursor)
__pyx_v_valid = __pyx_f_7questdb_7_client__dataframe_arrow_is_valid((&__pyx_v_col->cursor));
4293: cdef int64_t* access
4294: cdef int64_t cell
+4295: if valid:
if (__pyx_v_valid) {
/* … */
goto __pyx_L3;
}
+4296: access = <int64_t*>col.cursor.chunk.buffers[1]
__pyx_v_access = ((int64_t *)(__pyx_v_col->cursor.chunk->buffers[1]));
+4297: cell = access[col.cursor.offset]
__pyx_v_cell = (__pyx_v_access[__pyx_v_col->cursor.offset]);
4298: # Note: ls_buf will validate against negative numbers.
+4299: if not line_sender_buffer_at_micros(ls_buf, cell, &err):
__pyx_t_1 = (!line_sender_buffer_at_micros(__pyx_v_ls_buf, __pyx_v_cell, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
+4300: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4301: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4301, __pyx_L1_error)
4302: else:
+4303: if not line_sender_buffer_at_now(ls_buf, &err):
/*else*/ {
__pyx_t_1 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_1)) {
/* … */
}
}
__pyx_L3:;
+4304: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4305: raise c_err_to_py(err)
__pyx_t_2 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(2, 4305, __pyx_L1_error)
4306:
4307:
+4308: cdef void_int _dataframe_serialize_cell(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_serialize_cell(struct line_sender_buffer *__pyx_v_ls_buf, struct qdb_pystr_buf *__pyx_v_b, struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col, PyThreadState **__pyx_v_gs) {
enum __pyx_t_7questdb_7_client_col_dispatch_code_t __pyx_v_dc;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* 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_6);
__Pyx_AddTraceback("questdb._client._dataframe_serialize_cell", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4309: line_sender_buffer* ls_buf,
4310: qdb_pystr_buf* b,
4311: col_t* col,
4312: PyThreadState** gs) except -1:
+4313: cdef col_dispatch_code_t dc = col.dispatch_code
__pyx_t_1 = __pyx_v_col->dispatch_code; __pyx_v_dc = __pyx_t_1;
4314: global _dataframe_row_path_emissions
+4315: if _dataframe_count_row_path_emissions:
if (__pyx_v_7questdb_7_client__dataframe_count_row_path_emissions) {
/* … */
}
+4316: _dataframe_row_path_emissions += 1
__pyx_v_7questdb_7_client__dataframe_row_path_emissions = (__pyx_v_7questdb_7_client__dataframe_row_path_emissions + 1);
4317: # Note!: Code below will generate a `switch` statement.
4318: # Ensure this happens! Don't break the `dc == ...` pattern.
+4319: if dc == col_dispatch_code_t.col_dispatch_code_skip_nulls:
switch (__pyx_v_dc) {
case __pyx_e_7questdb_7_client_col_dispatch_code_skip_nulls:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_pyobj:
4320: pass # We skip a null column. Nothing to do.
+4321: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_utf8_arrow:
+4322: _dataframe_serialize_cell_table__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4322, __pyx_L1_error)
+4323: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_lrg_utf8_arrow:
+4324: _dataframe_serialize_cell_table__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4324, __pyx_L1_error)
+4325: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i8_cat:
+4326: _dataframe_serialize_cell_table__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4326, __pyx_L1_error)
+4327: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i16_cat:
+4328: _dataframe_serialize_cell_table__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4328, __pyx_L1_error)
+4329: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_table__str_i32_cat:
+4330: _dataframe_serialize_cell_table__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4330, __pyx_L1_error)
+4331: elif dc == col_dispatch_code_t.col_dispatch_code_table__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_pyobj:
+4332: _dataframe_serialize_cell_table__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_table__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4332, __pyx_L1_error)
+4333: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_utf8_arrow:
+4334: _dataframe_serialize_cell_symbol__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4334, __pyx_L1_error)
+4335: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_lrg_utf8_arrow:
+4336: _dataframe_serialize_cell_symbol__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4336, __pyx_L1_error)
+4337: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i8_cat:
+4338: _dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4338, __pyx_L1_error)
+4339: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i16_cat:
+4340: _dataframe_serialize_cell_symbol__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4340, __pyx_L1_error)
+4341: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_symbol__str_i32_cat:
+4342: _dataframe_serialize_cell_symbol__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4342, __pyx_L1_error)
+4343: elif dc == col_dispatch_code_t.col_dispatch_code_symbol__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_pyobj:
+4344: _dataframe_serialize_cell_symbol__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_symbol__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4344, __pyx_L1_error)
+4345: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_numpy:
+4346: _dataframe_serialize_cell_column_bool__bool_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4346, __pyx_L1_error)
+4347: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_bool__bool_arrow:
+4348: _dataframe_serialize_cell_column_bool__bool_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4348, __pyx_L1_error)
+4349: elif dc == col_dispatch_code_t.col_dispatch_code_column_bool__bool_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__int_pyobj:
+4350: _dataframe_serialize_cell_column_bool__bool_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_bool__bool_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4350, __pyx_L1_error)
+4351: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__int_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_numpy:
+4352: _dataframe_serialize_cell_column_i64__int_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__int_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4352, __pyx_L1_error)
+4353: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u8_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_numpy:
+4354: _dataframe_serialize_cell_column_i64__u8_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4354, __pyx_L1_error)
+4355: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i8_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_numpy:
+4356: _dataframe_serialize_cell_column_i64__i8_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4356, __pyx_L1_error)
+4357: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u16_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_numpy:
+4358: _dataframe_serialize_cell_column_i64__u16_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4358, __pyx_L1_error)
+4359: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i16_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_numpy:
+4360: _dataframe_serialize_cell_column_i64__i16_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4360, __pyx_L1_error)
+4361: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_numpy:
+4362: _dataframe_serialize_cell_column_i64__u32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4362, __pyx_L1_error)
+4363: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_numpy:
+4364: _dataframe_serialize_cell_column_i64__i32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4364, __pyx_L1_error)
+4365: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_numpy:
+4366: _dataframe_serialize_cell_column_i64__u64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4366, __pyx_L1_error)
+4367: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u8_arrow:
+4368: _dataframe_serialize_cell_column_i64__i64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4368, __pyx_L1_error)
+4369: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i8_arrow:
+4370: _dataframe_serialize_cell_column_i64__u8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4370, __pyx_L1_error)
+4371: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u16_arrow:
+4372: _dataframe_serialize_cell_column_i64__i8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4372, __pyx_L1_error)
+4373: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u16_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i16_arrow:
+4374: _dataframe_serialize_cell_column_i64__u16_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u16_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4374, __pyx_L1_error)
+4375: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i16_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u32_arrow:
+4376: _dataframe_serialize_cell_column_i64__i16_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i16_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4376, __pyx_L1_error)
+4377: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i32_arrow:
+4378: _dataframe_serialize_cell_column_i64__u32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4378, __pyx_L1_error)
+4379: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__u64_arrow:
+4380: _dataframe_serialize_cell_column_i64__i32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4380, __pyx_L1_error)
+4381: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__u64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_i64__i64_arrow:
+4382: _dataframe_serialize_cell_column_i64__u64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__u64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4382, __pyx_L1_error)
+4383: elif dc == col_dispatch_code_t.col_dispatch_code_column_i64__i64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__float_pyobj:
+4384: _dataframe_serialize_cell_column_i64__i64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_i64__i64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4384, __pyx_L1_error)
+4385: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__float_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_numpy:
+4386: _dataframe_serialize_cell_column_f64__float_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__float_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4386, __pyx_L1_error)
+4387: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f32_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_numpy:
+4388: _dataframe_serialize_cell_column_f64__f32_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4388, __pyx_L1_error)
+4389: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f64_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f32_arrow:
+4390: _dataframe_serialize_cell_column_f64__f64_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4390, __pyx_L1_error)
+4391: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_f64__f64_arrow:
+4392: _dataframe_serialize_cell_column_f64__f32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4392, __pyx_L1_error)
+4393: elif dc == col_dispatch_code_t.col_dispatch_code_column_f64__f64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_pyobj:
+4394: _dataframe_serialize_cell_column_f64__f64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_f64__f64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4394, __pyx_L1_error)
+4395: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_utf8_arrow:
+4396: _dataframe_serialize_cell_column_str__str_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4396, __pyx_L1_error)
+4397: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_lrg_utf8_arrow:
+4398: _dataframe_serialize_cell_column_str__str_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4398, __pyx_L1_error)
+4399: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_lrg_utf8_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i8_cat:
+4400: _dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_lrg_utf8_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4400, __pyx_L1_error)
+4401: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i8_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i16_cat:
+4402: _dataframe_serialize_cell_column_str__str_i8_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i8_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4402, __pyx_L1_error)
+4403: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i16_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_str__str_i32_cat:
+4404: _dataframe_serialize_cell_column_str__str_i16_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i16_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4404, __pyx_L1_error)
+4405: elif dc == col_dispatch_code_t.col_dispatch_code_column_str__str_i32_cat:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_numpy:
+4406: _dataframe_serialize_cell_column_str__str_i32_cat(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_str__str_i32_cat(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4406, __pyx_L1_error)
+4407: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64ns_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_numpy:
+4408: _dataframe_serialize_cell_column_ts__dt64ns_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4408, __pyx_L1_error)
+4409: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64us_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__datetime_pyobj:
+4410: _dataframe_serialize_cell_column_ts__dt64us_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4410, __pyx_L1_error)
+4411: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__datetime_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_arr_f64__arr_f64_numpyobj:
+4412: _dataframe_serialize_cell_column_ts__datetime_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__datetime_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4412, __pyx_L1_error)
+4413: elif dc == col_dispatch_code_t.col_dispatch_code_column_arr_f64__arr_f64_numpyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal_pyobj:
+4414: _dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_arr_f64__arr_f64_numpyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4414, __pyx_L1_error)
+4415: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal_pyobj:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal32_arrow:
+4416: _dataframe_serialize_cell_column_decimal__decimal_pyobj(ls_buf, b, col)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal_pyobj(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4416, __pyx_L1_error)
+4417: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal32_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal64_arrow:
+4418: _dataframe_serialize_cell_column_decimal__decimal32_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal32_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4418, __pyx_L1_error)
+4419: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal64_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal128_arrow:
+4420: _dataframe_serialize_cell_column_decimal__decimal64_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal64_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4420, __pyx_L1_error)
+4421: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal128_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_decimal__decimal256_arrow:
+4422: _dataframe_serialize_cell_column_decimal__decimal128_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal128_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4422, __pyx_L1_error)
+4423: elif dc == col_dispatch_code_t.col_dispatch_code_column_decimal__decimal256_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64ns_tz_arrow:
+4424: _dataframe_serialize_cell_column_decimal__decimal256_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_decimal__decimal256_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4424, __pyx_L1_error)
+4425: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64ns_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_column_ts__dt64us_tz_arrow:
+4426: _dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64ns_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4426, __pyx_L1_error)
+4427: elif dc == col_dispatch_code_t.col_dispatch_code_column_ts__dt64us_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_numpy:
+4428: _dataframe_serialize_cell_column_ts__dt64us_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_column_ts__dt64us_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4428, __pyx_L1_error)
+4429: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64ns_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_numpy:
+4430: _dataframe_serialize_cell_at_dt64ns_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4430, __pyx_L1_error)
+4431: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64us_numpy:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64ns_tz_arrow:
+4432: _dataframe_serialize_cell_at_dt64us_numpy(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_numpy(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4432, __pyx_L1_error)
+4433: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64ns_tz_arrow:
break;
case __pyx_e_7questdb_7_client_col_dispatch_code_at__dt64us_tz_arrow:
+4434: _dataframe_serialize_cell_at_dt64ns_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64ns_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4434, __pyx_L1_error)
+4435: elif dc == col_dispatch_code_t.col_dispatch_code_at__dt64us_tz_arrow:
break;
default:
+4436: _dataframe_serialize_cell_at_dt64us_tz_arrow(ls_buf, b, col, gs)
__pyx_t_2 = __pyx_f_7questdb_7_client__dataframe_serialize_cell_at_dt64us_tz_arrow(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, __pyx_v_gs); if (unlikely(__pyx_t_2 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4436, __pyx_L1_error)
4437: else:
+4438: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
+4439: raise RuntimeError(f"Unknown column dispatch code: {dc}")
__pyx_t_4 = NULL;
__pyx_t_5 = __Pyx_PyUnicode_From_enum____pyx_t_7questdb_7_client_col_dispatch_code_t(__pyx_v_dc, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_column_dispatch_code, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
__pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __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;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(2, 4439, __pyx_L1_error)
break;
}
4440: # See earlier note about switch statement generation.
4441: # Don't add complex conditions above!
4442:
4443:
+4444: cdef void _dataframe_col_advance(col_t* col) noexcept nogil:
static void __pyx_f_7questdb_7_client__dataframe_col_advance(struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col) {
struct __pyx_t_7questdb_7_client_col_cursor_t *__pyx_v_cursor;
/* … */
/* function exit code */
}
+4445: cdef col_cursor_t* cursor = &col.cursor
__pyx_v_cursor = (&__pyx_v_col->cursor);
+4446: cursor.offset += 1
__pyx_v_cursor->offset = (__pyx_v_cursor->offset + 1);
4447: # Note: We get away with accessing `cursor.chunk.offset` past the last
4448: # chunk because we've allocated one extra blank chunk.
+4449: while ((cursor.chunk_index < col.setup.chunks.n_chunks) and
while (1) {
__pyx_t_2 = (__pyx_v_cursor->chunk_index < __pyx_v_col->setup->chunks.n_chunks);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
+4450: (cursor.offset ==
__pyx_t_2 = (__pyx_v_cursor->offset == ((size_t)(__pyx_v_cursor->chunk->offset + __pyx_v_cursor->chunk->length)));
__pyx_t_1 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
if (!__pyx_t_1) break;
4451: <size_t>(cursor.chunk.offset + cursor.chunk.length))):
+4452: cursor.chunk_index += 1
__pyx_v_cursor->chunk_index = (__pyx_v_cursor->chunk_index + 1);
+4453: cursor.chunk += 1
__pyx_v_cursor->chunk = (__pyx_v_cursor->chunk + 1);
+4454: cursor.offset = cursor.chunk.offset
__pyx_t_3 = __pyx_v_cursor->chunk->offset;
__pyx_v_cursor->offset = __pyx_t_3;
}
4455:
4456:
+4457: cdef void_int _dataframe_handle_auto_flush(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe_handle_auto_flush(struct __pyx_t_7questdb_7_client_auto_flush_t const *__pyx_v_af, struct line_sender_buffer *__pyx_v_ls_buf, PyThreadState **__pyx_v_gs) {
struct line_sender_error *__pyx_v_flush_err;
struct line_sender_error *__pyx_v_marker_err;
int __pyx_v_flush_ok;
int __pyx_v_marker_ok;
struct line_sender *__pyx_v_sender;
int __pyx_v_had_gil;
__pyx_t_7questdb_7_client_void_int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("questdb._client._dataframe_handle_auto_flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4458: const auto_flush_t* af,
4459: line_sender_buffer* ls_buf,
4460: PyThreadState** gs) except -1:
+4461: cdef line_sender_error* flush_err = NULL
__pyx_v_flush_err = NULL;
+4462: cdef line_sender_error* marker_err = NULL
__pyx_v_marker_err = NULL;
4463: cdef bint flush_ok
4464: cdef bint marker_ok
+4465: cdef line_sender* sender = NULL
__pyx_v_sender = NULL;
4466: # Read now, not when the run started: a `close()` from a cell's own
4467: # Python nulls the field, and this is the point that would otherwise
4468: # flush through the pointer it left behind.
+4469: if af.sender_slot != NULL:
__pyx_t_1 = (__pyx_v_af->sender_slot != NULL);
if (__pyx_t_1) {
/* … */
}
+4470: sender = af.sender_slot[0]
__pyx_v_sender = (__pyx_v_af->sender_slot[0]);
+4471: if (sender == NULL) or (not should_auto_flush(&af.mode, ls_buf, af.last_flush_ms[0])):
__pyx_t_2 = (__pyx_v_sender == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = __pyx_f_7questdb_7_client_should_auto_flush((&__pyx_v_af->mode), __pyx_v_ls_buf, (__pyx_v_af->last_flush_ms[0])); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 4471, __pyx_L1_error)
__pyx_t_3 = (!__pyx_t_2);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+4472: return 0
{
__pyx_r = 0;
}
goto __pyx_L0;
4473:
4474: # Always temporarily release GIL during a flush.
+4475: had_gil = _ensure_doesnt_have_gil(gs)
__pyx_v_had_gil = __pyx_f_7questdb_7_client__ensure_doesnt_have_gil(__pyx_v_gs);
+4476: flush_ok = line_sender_flush(sender, ls_buf, &flush_err)
__pyx_v_flush_ok = line_sender_flush(__pyx_v_sender, __pyx_v_ls_buf, (&__pyx_v_flush_err));
+4477: if flush_ok:
if (__pyx_v_flush_ok) {
/* … */
goto __pyx_L7;
}
+4478: af.last_flush_ms[0] = line_sender_now_micros() // 1000
(__pyx_v_af->last_flush_ms[0]) = __Pyx_div_int64_t(line_sender_now_micros(), 0x3E8, 1);
4479: else:
4480: # To avoid flush reattempt on Sender.__exit__.
+4481: line_sender_buffer_clear(ls_buf)
/*else*/ {
line_sender_buffer_clear(__pyx_v_ls_buf);
}
__pyx_L7:;
4482:
4483: # Flushing will have cleared the marker: We need to set it again
4484: # We need this also on error due to our error handling logic which will
4485: # try to rewind the buffer on error and fail if the marker is unset.
+4486: marker_ok = line_sender_buffer_set_marker(ls_buf, &marker_err)
__pyx_v_marker_ok = line_sender_buffer_set_marker(__pyx_v_ls_buf, (&__pyx_v_marker_err));
4487:
+4488: if had_gil or (not flush_ok) or (not marker_ok):
if (!__pyx_v_had_gil) {
} else {
__pyx_t_1 = __pyx_v_had_gil;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_3 = (!__pyx_v_flush_ok);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_3 = (!__pyx_v_marker_ok);
__pyx_t_1 = __pyx_t_3;
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
/* … */
}
+4489: _ensure_has_gil(gs)
__pyx_f_7questdb_7_client__ensure_has_gil(__pyx_v_gs);
4490:
+4491: if not flush_ok:
__pyx_t_1 = (!__pyx_v_flush_ok);
if (__pyx_t_1) {
/* … */
}
+4492: if not marker_ok:
__pyx_t_1 = (!__pyx_v_marker_ok);
if (__pyx_t_1) {
/* … */
}
+4493: line_sender_error_free(marker_err)
line_sender_error_free(__pyx_v_marker_err);
+4494: raise c_err_to_py_fmt(flush_err, _FLUSH_FMT)
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FLUSH_FMT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(2, 4494, __pyx_L1_error) __pyx_t_5 = __pyx_f_7questdb_7_client_c_err_to_py_fmt(__pyx_v_flush_err, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(2, 4494, __pyx_L1_error)
4495:
4496: # The flush error takes precedence over the marker error.
+4497: if not marker_ok:
__pyx_t_1 = (!__pyx_v_marker_ok);
if (unlikely(__pyx_t_1)) {
/* … */
}
+4498: raise c_err_to_py(marker_err)
__pyx_t_5 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_marker_err); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 4498, __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(2, 4498, __pyx_L1_error)
4499:
4500:
4501: # Every how many cells to release and re-acquire the Python GIL.
4502: #
4503: # We've done some perf testing with some mixed column dtypes.
4504: # On a modern CPU we're doing over 8 million pandas cells per second.
4505: # By default, `sys.getswitchinterval()` is 0.005 seconds.
4506: # To accomodate this, we'd need to release the GIL every 40,000 cells.
4507: # This will be divided by the column count to get the row gil blip interval.
+4508: cdef size_t _CELL_GIL_BLIP_INTERVAL = 40000
__pyx_v_7questdb_7_client__CELL_GIL_BLIP_INTERVAL = 0x9C40;
4509:
4510:
+4511: cdef void_int _dataframe(
static __pyx_t_7questdb_7_client_void_int __pyx_f_7questdb_7_client__dataframe(struct __pyx_obj_7questdb_7_client_Buffer *__pyx_v_owner, struct __pyx_t_7questdb_7_client_auto_flush_t __pyx_v_af, struct line_sender_buffer *__pyx_v_ls_buf, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
struct __pyx_t_7questdb_7_client_dataframe_plan_t __pyx_v_plan;
struct qdb_pystr_buf *__pyx_v_b;
struct line_sender_error *__pyx_v_err;
size_t __pyx_v_row_index;
size_t __pyx_v_col_index;
struct __pyx_t_7questdb_7_client_col_t *__pyx_v_col;
size_t __pyx_v_row_gil_blip_interval;
PyThreadState *__pyx_v_gs;
int __pyx_v_was_serializing_cell;
int __pyx_v_was_auto_flush;
int __pyx_v_plan_has_content;
PyObject *__pyx_v_e = NULL;
__pyx_t_7questdb_7_client_void_int __pyx_r;
__Pyx_INCREF(__pyx_v_df);
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_19);
__Pyx_XDECREF(__pyx_t_20);
__Pyx_XDECREF(__pyx_t_21);
__Pyx_XDECREF(__pyx_t_22);
__Pyx_XDECREF(__pyx_t_23);
__Pyx_XDECREF(__pyx_t_24);
__Pyx_XDECREF(__pyx_t_27);
__Pyx_XDECREF(__pyx_t_28);
__Pyx_XDECREF(__pyx_t_29);
__Pyx_XDECREF(__pyx_t_30);
__Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_e);
__Pyx_XDECREF(__pyx_v_df);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4512: Buffer owner,
4513: auto_flush_t af,
4514: line_sender_buffer* ls_buf,
4515: object df,
4516: object table_name,
4517: object table_name_col,
4518: object symbols,
4519: object at) except -1:
4520: """Serialize a whole frame into `owner`'s native buffer, row by row.
4521:
4522: `owner` is the `Buffer` whose `ls_buf` and `b` these are. It drives
4523: the same native buffer `Buffer.row` does -- rewind points included
4524: -- so it counts into the same `_row_depth`, and everything that
4525: refuses to clear or flush a buffer part-way through a row refuses
4526: part-way through a frame too. A cell of Python objects can run
4527: arbitrary code, so the callers that could come back in are the same
4528: ones.
4529: """
+4530: cdef dataframe_plan_t plan = dataframe_plan_blank()
__pyx_v_plan = __pyx_f_7questdb_7_client_dataframe_plan_blank();
+4531: cdef qdb_pystr_buf* b = NULL
__pyx_v_b = NULL;
+4532: cdef line_sender_error* err = NULL
__pyx_v_err = NULL;
4533: cdef size_t row_index
4534: cdef size_t col_index
4535: cdef col_t* col
4536: cdef size_t row_gil_blip_interval
+4537: cdef PyThreadState* gs = NULL # GIL state. NULL means we have the GIL.
__pyx_v_gs = NULL;
4538: cdef bint had_gil
+4539: cdef bint was_serializing_cell = False
__pyx_v_was_serializing_cell = 0;
+4540: cdef bint was_auto_flush = False
__pyx_v_was_auto_flush = 0;
4541: cdef bint plan_has_content
4542:
4543: # Refused, not counted, when a row or another frame is already
4544: # part-way through this buffer: the plan below clears the marker
4545: # the outer row rewinds to, and an outer failure would then leave
4546: # its part-written row in the buffer. This covers every route
4547: # that arrives here -- `Buffer.dataframe`,
4548: # `SenderTransaction.dataframe` and `Sender.dataframe` on the ILP
4549: # protocols. `Sender.dataframe` over QWP/WebSocket takes its own
4550: # connection and checks there.
+4551: owner._check_not_in_row('dataframe')
__pyx_t_1 = __pyx_f_7questdb_7_client_6Buffer__check_not_in_row(__pyx_v_owner, __pyx_mstate_global->__pyx_n_u_dataframe, NULL); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4551, __pyx_L1_error)
4552: # The run's string storage is its own. The plan's table and column
4553: # names live in it for the whole frame, and `qdb_pystr_buf_clear`
4554: # drops every chunk past the first, so a `clear()` re-entered from a
4555: # cell's own Python would free storage the plan is still reading
4556: # names out of. Private storage is storage no caller can reach to
4557: # recycle, which is what keeps that safe without a guard having to
4558: # name every route a `clear()` can arrive through.
+4559: b = qdb_pystr_buf_new()
__pyx_v_b = qdb_pystr_buf_new();
+4560: if b == NULL:
__pyx_t_2 = (__pyx_v_b == NULL);
if (unlikely(__pyx_t_2)) {
/* … */
}
+4561: raise MemoryError()
PyErr_NoMemory(); __PYX_ERR(2, 4561, __pyx_L1_error)
+4562: owner._row_depth += 1
__pyx_v_owner->_row_depth = (__pyx_v_owner->_row_depth + 1);
+4563: try:
/*try:*/ {
{
/*try:*/ {
/* … */
}
__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_L12_try_end;
__pyx_L7_error:;
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
__Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
__Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
__Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
__Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* … */
__pyx_L9_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_L5_error;
__pyx_L11_try_return:;
__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_L4_return;
__pyx_L12_try_end:;
}
}
+4564: df = _dataframe_freeze_claim(df)
__pyx_t_6 = __pyx_f_7questdb_7_client__dataframe_freeze_claim(__pyx_v_df); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4564, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_df, __pyx_t_6); __pyx_t_6 = 0;
4565: # Said before the plan is built, so a frame refused for its
4566: # shape still hears which of its claims this route would have
4567: # ignored.
+4568: _dataframe_log_claim_problems(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_log_claim_problems(__pyx_v_df); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4568, __pyx_L7_error)
+4569: _dataframe_log_claims_this_route_drops(df)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_log_claims_this_route_drops(__pyx_v_df); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4569, __pyx_L7_error)
+4570: _dataframe_plan_build(
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_plan_build(__pyx_v_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at, (&__pyx_v_plan), ((PyObject*)__pyx_t_6)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4570, __pyx_L7_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4571: b,
4572: df,
4573: table_name,
4574: table_name_col,
4575: symbols,
4576: at,
4577: &plan,
+4578: _FIELD_TARGETS_ROW)
__pyx_t_6 = __pyx_v_7questdb_7_client__FIELD_TARGETS_ROW;
__Pyx_INCREF(__pyx_t_6);
+4579: if (plan.col_count == 0) or (plan.row_count == 0):
__pyx_t_7 = (__pyx_v_plan.col_count == 0);
if (!__pyx_t_7) {
} else {
__pyx_t_2 = __pyx_t_7;
goto __pyx_L14_bool_binop_done;
}
__pyx_t_7 = (__pyx_v_plan.row_count == 0);
__pyx_t_2 = __pyx_t_7;
__pyx_L14_bool_binop_done:;
if (__pyx_t_2) {
/* … */
}
+4580: return 0 # Nothing to do.
{
__pyx_r = 0;
}
goto __pyx_L11_try_return;
+4581: line_sender_buffer_clear_marker(ls_buf)
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
4582:
4583: # On error, undo all added lines.
+4584: if not line_sender_buffer_set_marker(ls_buf, &err):
__pyx_t_2 = (!line_sender_buffer_set_marker(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4585: raise c_err_to_py(err)
__pyx_t_6 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4585, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(2, 4585, __pyx_L7_error)
4586:
+4587: row_gil_blip_interval = _CELL_GIL_BLIP_INTERVAL // plan.col_count
if (unlikely(__pyx_v_plan.col_count == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(2, 4587, __pyx_L7_error)
}
__pyx_v_row_gil_blip_interval = (__pyx_v_7questdb_7_client__CELL_GIL_BLIP_INTERVAL / __pyx_v_plan.col_count);
+4588: if row_gil_blip_interval < 400: # ceiling reached at 100 columns
__pyx_t_2 = (__pyx_v_row_gil_blip_interval < 0x190);
if (__pyx_t_2) {
/* … */
}
+4589: row_gil_blip_interval = 400
__pyx_v_row_gil_blip_interval = 0x190;
+4590: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L23_try_end;
__pyx_L18_error:;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* … */
__pyx_L20_except_error:;
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
goto __pyx_L7_error;
__pyx_L23_try_end:;
}
4591: # Don't move this logic up! We need the GIL to execute a `try`.
4592: # Also we can't have any other `try` blocks between here and the
4593: # `finally` block.
+4594: if not plan.any_cols_need_gil:
__pyx_t_2 = (!__pyx_v_plan.any_cols_need_gil);
if (__pyx_t_2) {
/* … */
}
+4595: _ensure_doesnt_have_gil(&gs)
(void)(__pyx_f_7questdb_7_client__ensure_doesnt_have_gil((&__pyx_v_gs)));
4596:
+4597: for row_index in range(plan.row_count):
__pyx_t_11 = __pyx_v_plan.row_count;
__pyx_t_12 = __pyx_t_11;
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
__pyx_v_row_index = __pyx_t_13;
+4598: if (gs == NULL) and (row_index % row_gil_blip_interval == 0):
__pyx_t_7 = (__pyx_v_gs == NULL);
if (__pyx_t_7) {
} else {
__pyx_t_2 = __pyx_t_7;
goto __pyx_L28_bool_binop_done;
}
if (unlikely(__pyx_v_row_gil_blip_interval == 0)) {
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
__PYX_ERR(2, 4598, __pyx_L18_error)
}
__pyx_t_7 = ((__pyx_v_row_index % __pyx_v_row_gil_blip_interval) == 0);
__pyx_t_2 = __pyx_t_7;
__pyx_L28_bool_binop_done:;
if (__pyx_t_2) {
/* … */
}
4599: # Release and re-acquire the GIL every so often.
4600: # This is to allow other python threads to run.
4601: # If we hold the GIL for too long, we can starve other
4602: # threads, for example timing out network activity.
+4603: _ensure_doesnt_have_gil(&gs)
(void)(__pyx_f_7questdb_7_client__ensure_doesnt_have_gil((&__pyx_v_gs)));
+4604: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
4605:
+4606: qdb_pystr_buf_truncate(b, plan.str_buf_marker)
qdb_pystr_buf_truncate(__pyx_v_b, __pyx_v_plan.str_buf_marker);
4607:
4608: # Table-name from `table_name` arg in Python.
+4609: if plan.c_table_name.buf != NULL:
__pyx_t_2 = (__pyx_v_plan.c_table_name.buf != NULL);
if (__pyx_t_2) {
/* … */
}
+4610: if not line_sender_buffer_table(ls_buf, plan.c_table_name, &err):
__pyx_t_2 = (!line_sender_buffer_table(__pyx_v_ls_buf, __pyx_v_plan.c_table_name, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4611: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
+4612: raise c_err_to_py(err)
__pyx_t_6 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4612, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(2, 4612, __pyx_L18_error)
4613:
4614: # Serialize columns cells.
4615: # Note: Columns are sorted: table name, symbols, fields, at.
+4616: was_serializing_cell = True
__pyx_v_was_serializing_cell = 1;
+4617: for col_index in range(plan.col_count):
__pyx_t_14 = __pyx_v_plan.col_count;
__pyx_t_15 = __pyx_t_14;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_col_index = __pyx_t_16;
+4618: col = &plan.cols.d[col_index]
__pyx_v_col = (&(__pyx_v_plan.cols.d[__pyx_v_col_index]));
+4619: _dataframe_serialize_cell(ls_buf, b, col, &gs) # may raise
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_serialize_cell(__pyx_v_ls_buf, __pyx_v_b, __pyx_v_col, (&__pyx_v_gs)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4619, __pyx_L18_error)
+4620: _dataframe_col_advance(col)
__pyx_f_7questdb_7_client__dataframe_col_advance(__pyx_v_col);
}
+4621: was_serializing_cell = False
__pyx_v_was_serializing_cell = 0;
4622:
4623: # Fixed "at" value (not from a column).
+4624: if plan.at_value == _AT_IS_SERVER_NOW:
__pyx_t_2 = (__pyx_v_plan.at_value == __pyx_v_7questdb_7_client__AT_IS_SERVER_NOW);
if (__pyx_t_2) {
/* … */
goto __pyx_L34;
}
+4625: if not line_sender_buffer_at_now(ls_buf, &err):
__pyx_t_2 = (!line_sender_buffer_at_now(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4626: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
+4627: raise c_err_to_py(err)
__pyx_t_6 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4627, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(2, 4627, __pyx_L18_error)
+4628: elif plan.at_value >= 0:
__pyx_t_2 = (__pyx_v_plan.at_value >= 0);
if (__pyx_t_2) {
/* … */
}
__pyx_L34:;
+4629: if not line_sender_buffer_at_nanos(ls_buf, plan.at_value, &err):
__pyx_t_2 = (!line_sender_buffer_at_nanos(__pyx_v_ls_buf, __pyx_v_plan.at_value, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4630: _ensure_has_gil(&gs)
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
+4631: raise c_err_to_py(err)
__pyx_t_6 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4631, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(2, 4631, __pyx_L18_error)
4632:
+4633: was_auto_flush = True
__pyx_v_was_auto_flush = 1;
+4634: _dataframe_handle_auto_flush(&af, ls_buf, &gs)
__pyx_t_1 = __pyx_f_7questdb_7_client__dataframe_handle_auto_flush((&__pyx_v_af), __pyx_v_ls_buf, (&__pyx_v_gs)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7_client_void_int)-1))) __PYX_ERR(2, 4634, __pyx_L18_error)
+4635: was_auto_flush = False
__pyx_v_was_auto_flush = 0;
}
+4636: except Exception as e:
__pyx_t_17 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_17) { __Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_18, &__pyx_t_19) < 0) __PYX_ERR(2, 4636, __pyx_L20_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_INCREF(__pyx_t_18); __pyx_v_e = __pyx_t_18; /*try:*/ { /* … */ /*finally:*/ { __pyx_L42_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_34 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0; __Pyx_ExceptionSwap(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39); if ( unlikely(__Pyx_GetException(&__pyx_t_34, &__pyx_t_35, &__pyx_t_36) < 0)) __Pyx_ErrFetch(&__pyx_t_34, &__pyx_t_35, &__pyx_t_36); __Pyx_XGOTREF(__pyx_t_34); __Pyx_XGOTREF(__pyx_t_35); __Pyx_XGOTREF(__pyx_t_36); __Pyx_XGOTREF(__pyx_t_37); __Pyx_XGOTREF(__pyx_t_38); __Pyx_XGOTREF(__pyx_t_39); __pyx_t_17 = __pyx_lineno; __pyx_t_32 = __pyx_clineno; __pyx_t_33 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_37); __Pyx_XGIVEREF(__pyx_t_38); __Pyx_XGIVEREF(__pyx_t_39); __Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39); __Pyx_XGIVEREF(__pyx_t_34); __Pyx_XGIVEREF(__pyx_t_35); __Pyx_XGIVEREF(__pyx_t_36); __Pyx_ErrRestore(__pyx_t_34, __pyx_t_35, __pyx_t_36); __pyx_t_34 = 0; __pyx_t_35 = 0; __pyx_t_36 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_32; __pyx_filename = __pyx_t_33; goto __pyx_L20_except_error; } } }
4637: # It would be an internal bug for this to raise.
+4638: if not line_sender_buffer_rewind_to_marker(ls_buf, &err):
__pyx_t_2 = (!line_sender_buffer_rewind_to_marker(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4639: raise c_err_to_py(err)
__pyx_t_20 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4639, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_Raise(__pyx_t_20, 0, 0, 0); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __PYX_ERR(2, 4639, __pyx_L42_error)
4640:
+4641: if (isinstance(e, QuestDBError) and
__Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4641, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_7 = PyObject_IsInstance(__pyx_v_e, __pyx_t_20); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 4641, __pyx_L42_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L46_bool_binop_done; } /* … */ if (unlikely(__pyx_t_2)) { /* … */ }
+4642: (e.code == QuestDBErrorCode.InvalidApiCall) and not was_auto_flush):
__pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_code); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4642, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 4642, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4642, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_7 = __Pyx_PyObject_CompareBoolEq_object_object(__pyx_t_20, __pyx_t_22, Py_EQ); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(2, 4642, __pyx_L42_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L46_bool_binop_done; } __pyx_t_7 = (!__pyx_v_was_auto_flush); __pyx_t_2 = __pyx_t_7; __pyx_L46_bool_binop_done:;
4643: # TODO: This should be allowed by the database.
4644: # It currently isn't so we have to raise an error.
+4645: raise QuestDBError(
__pyx_t_20 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 4645, __pyx_L42_error)
__Pyx_GOTREF(__pyx_t_21);
+4646: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 4646, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4646, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
+4647: f'Bad dataframe row at index {row_index}: ' +
__pyx_t_23 = __Pyx_PyUnicode_From_size_t(__pyx_v_row_index, 0, ' ', 'd'); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 4647, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_25[0] = __pyx_mstate_global->__pyx_kp_u_Bad_dataframe_row_at_index; __pyx_t_25[1] = __pyx_t_23; __pyx_t_25[2] = __pyx_mstate_global->__pyx_kp_u_All_values_are_nulls_Ensure_at; __pyx_t_26 = 90; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_26 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25[1]); #endif __pyx_t_17 = 0; __pyx_t_27 = __Pyx_PyUnicode_Join(__pyx_t_25, 3, __pyx_t_26, __pyx_t_17); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 4647, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_27); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_21); assert(__pyx_t_20); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_21, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_24, __pyx_t_27}; __pyx_t_22 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_21, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4645, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_22); }
4648: 'All values are nulls. '+
+4649: 'Ensure at least one column is not null.') from e
__Pyx_Raise(__pyx_t_22, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __PYX_ERR(2, 4645, __pyx_L42_error)
+4650: elif was_serializing_cell:
if (unlikely(__pyx_v_was_serializing_cell)) {
/* … */
}
+4651: raise QuestDBError(
__pyx_t_21 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_27, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_27)) __PYX_ERR(2, 4651, __pyx_L42_error)
__Pyx_GOTREF(__pyx_t_27);
+4652: QuestDBErrorCode.BadDataFrame,
__Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4652, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_BadDataFrame); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4652, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
+4653: 'Failed to serialize value of column ' +
__pyx_t_23 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Failed_to_serialize_value_of_col, __pyx_t_24); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 4653, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
+4654: repr(df.columns[col.setup.orig_index]) +
__pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_columns); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4654, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_24, __pyx_v_col->setup->orig_index, size_t, 0, __Pyx_PyLong_FromSize_t, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 4654, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __pyx_t_24 = PyObject_Repr(__pyx_t_23); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4654, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; /* … */ __pyx_t_24 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_23, __pyx_t_28); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4654, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
+4655: f' at row index {row_index} (' +
__pyx_t_24 = __Pyx_PyUnicode_From_size_t(__pyx_v_row_index, 0, ' ', 'd'); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4655, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_25[0] = __pyx_mstate_global->__pyx_kp_u_at_row_index; __pyx_t_25[1] = __pyx_t_24; __pyx_t_25[2] = __pyx_mstate_global->__pyx_kp_u__15; __pyx_t_26 = 16; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_26 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25[1]); #endif __pyx_t_17 = 0; __pyx_t_28 = __Pyx_PyUnicode_Join(__pyx_t_25, 3, __pyx_t_26, __pyx_t_17); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 4655, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; /* … */ __pyx_t_29 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(__pyx_t_24, __pyx_t_30); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 4655, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_29); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+4656: repr(df.iloc[row_index, col.setup.orig_index]) +
__pyx_t_28 = __Pyx_PyObject_GetAttrStr(__pyx_v_df, __pyx_mstate_global->__pyx_n_u_iloc); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_28); __pyx_t_23 = __Pyx_PyLong_FromSize_t(__pyx_v_row_index); if (unlikely(!__pyx_t_23)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_29 = __Pyx_PyLong_FromSize_t(__pyx_v_col->setup->orig_index); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_29); __pyx_t_30 = PyTuple_New(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_30); __Pyx_GIVEREF(__pyx_t_23); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_23) != (0)) __PYX_ERR(2, 4656, __pyx_L42_error); __Pyx_GIVEREF(__pyx_t_29); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_t_29) != (0)) __PYX_ERR(2, 4656, __pyx_L42_error); __pyx_t_23 = 0; __pyx_t_29 = 0; __pyx_t_29 = __Pyx_PyObject_GetItem(__pyx_t_28, __pyx_t_30); if (unlikely(!__pyx_t_29)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_29); __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; __pyx_t_30 = PyObject_Repr(__pyx_t_29); if (unlikely(!__pyx_t_30)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_30); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; /* … */ __pyx_t_24 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_29, __pyx_t_28); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4656, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_27))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_27); assert(__pyx_t_21); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_27); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_27, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_21, __pyx_t_20, __pyx_t_24}; __pyx_t_22 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_27, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4651, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_22); }
+4657: f'): {e} [dc={<int>col.dispatch_code}]') from e
__pyx_t_30 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_30)) __PYX_ERR(2, 4657, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_30); __pyx_t_24 = __Pyx_PyUnicode_From_int(((int)__pyx_v_col->dispatch_code), 0, ' ', 'd'); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4657, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_24); __pyx_t_31[0] = __pyx_mstate_global->__pyx_kp_u__21; __pyx_t_31[1] = __pyx_t_30; __pyx_t_31[2] = __pyx_mstate_global->__pyx_kp_u_dc; __pyx_t_31[3] = __pyx_t_24; __pyx_t_31[4] = __pyx_mstate_global->__pyx_kp_u__17; __pyx_t_26 = 10; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_26 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_31[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_31[3]); #endif __pyx_t_17 = 0; #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH __pyx_t_17 |= __Pyx_PyUnicode_KIND_04(__pyx_t_31[1]); #endif __pyx_t_28 = __Pyx_PyUnicode_Join(__pyx_t_31, 5, __pyx_t_26, __pyx_t_17); if (unlikely(!__pyx_t_28)) __PYX_ERR(2, 4657, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_28); __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; /* … */ __Pyx_Raise(__pyx_t_22, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __PYX_ERR(2, 4651, __pyx_L42_error)
4658: else:
+4659: raise
/*else*/ {
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_19);
__Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_18, __pyx_t_19);
__pyx_t_6 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__PYX_ERR(2, 4659, __pyx_L42_error)
}
}
+4660: except BaseException:
__pyx_t_32 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_BaseException)))); if (__pyx_t_32) { __Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_19, &__pyx_t_18, &__pyx_t_6) < 0) __PYX_ERR(2, 4660, __pyx_L20_except_error) __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_6);
4661: # Whatever ends the run, the part-written row goes with it:
4662: # the buffer rewinds here, the `finally` below clears the
4663: # marker, and `_row_depth` returns to zero behind it, so
4664: # every guard downstream reads the buffer as idle. Anything
4665: # that is not an `Exception` -- an interrupt, an exit --
4666: # then goes on as itself rather than wrapped as a data
4667: # error. `Buffer._row` holds the same property with a bare
4668: # `except:`.
4669: #
4670: # This is the property held, not a closed list of cases.
4671: # In particular, an aware datetime object column computes
4672: # `dt - _EPOCH_AWARE_UTC`, which can call the caller's
4673: # `tzinfo.utcoffset()` while this row and its rewind marker
4674: # are live. If that hook raises an interrupt, an exit, or
4675: # another `BaseException`, this branch restores the buffer
4676: # before propagating it unchanged. It also keeps that rule
4677: # true for any future cell serializer that calls Python.
+4678: if not line_sender_buffer_rewind_to_marker(ls_buf, &err):
__pyx_t_2 = (!line_sender_buffer_rewind_to_marker(__pyx_v_ls_buf, (&__pyx_v_err)));
if (unlikely(__pyx_t_2)) {
/* … */
}
+4679: raise c_err_to_py(err)
__pyx_t_22 = __pyx_f_7questdb_7_client_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4679, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_Raise(__pyx_t_22, 0, 0, 0); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __PYX_ERR(2, 4679, __pyx_L20_except_error)
+4680: raise
__Pyx_GIVEREF(__pyx_t_19); __Pyx_GIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_19, __pyx_t_18, __pyx_t_6); __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_6 = 0; __PYX_ERR(2, 4680, __pyx_L20_except_error) } goto __pyx_L20_except_error;
+4681: except Exception as e:
__pyx_t_32 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_32) { __Pyx_AddTraceback("questdb._client._dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_18, &__pyx_t_19) < 0) __PYX_ERR(2, 4681, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_INCREF(__pyx_t_18); __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_18); /*try:*/ { /* … */ /*finally:*/ { __pyx_L61_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_39 = 0; __pyx_t_38 = 0; __pyx_t_37 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0; __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0; __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0; __Pyx_ExceptionSwap(&__pyx_t_39, &__pyx_t_38, &__pyx_t_37); if ( unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_39); __Pyx_XGOTREF(__pyx_t_38); __Pyx_XGOTREF(__pyx_t_37); __pyx_t_32 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_33 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_39); __Pyx_XGIVEREF(__pyx_t_38); __Pyx_XGIVEREF(__pyx_t_37); __Pyx_ExceptionReset(__pyx_t_39, __pyx_t_38, __pyx_t_37); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8); __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_39 = 0; __pyx_t_38 = 0; __pyx_t_37 = 0; __pyx_lineno = __pyx_t_32; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_33; goto __pyx_L9_except_error; } } } goto __pyx_L9_except_error;
+4682: if not isinstance(e, QuestDBError):
__Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4682, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_22); __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_22); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 4682, __pyx_L61_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_t_7 = (!__pyx_t_2); if (unlikely(__pyx_t_7)) { /* … */ }
+4683: raise QuestDBError(
__pyx_t_27 = NULL;
__Pyx_GetModuleGlobalName(__pyx_t_24, __pyx_mstate_global->__pyx_n_u_QuestDBError); if (unlikely(!__pyx_t_24)) __PYX_ERR(2, 4683, __pyx_L61_error)
__Pyx_GOTREF(__pyx_t_24);
+4684: QuestDBErrorCode.InvalidApiCall,
__Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_QuestDBErrorCode); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4684, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_InvalidApiCall); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 4684, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+4685: str(e)) from e
__pyx_t_20 = __Pyx_PyObject_Unicode(__pyx_v_e); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 4685, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_24))) { __pyx_t_27 = PyMethod_GET_SELF(__pyx_t_24); assert(__pyx_t_27); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_24); __Pyx_INCREF(__pyx_t_27); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_24, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_27, __pyx_t_21, __pyx_t_20}; __pyx_t_22 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_24, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; if (unlikely(!__pyx_t_22)) __PYX_ERR(2, 4683, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_22); } __Pyx_Raise(__pyx_t_22, 0, 0, __pyx_v_e); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __PYX_ERR(2, 4683, __pyx_L61_error)
4686: else:
+4687: raise
/*else*/ {
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_18);
__Pyx_XGIVEREF(__pyx_t_19);
__Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_18, __pyx_t_19);
__pyx_t_6 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
__PYX_ERR(2, 4687, __pyx_L61_error)
}
}
4688: finally:
+4689: _ensure_has_gil(&gs) # Note: We need the GIL for cleanup.
/*finally:*/ {
/*normal exit:*/{
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
/* … */
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
/* … */
__pyx_f_7questdb_7_client__ensure_has_gil((&__pyx_v_gs));
+4690: plan_has_content = (plan.col_count != 0) and (plan.row_count != 0)
__pyx_t_2 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
goto __pyx_L68_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_2;
__pyx_L68_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
/* … */
__pyx_t_2 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
goto __pyx_L73_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_2;
__pyx_L73_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
/* … */
__pyx_t_2 = (__pyx_v_plan.col_count != 0);
if (__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
goto __pyx_L76_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_plan.row_count != 0);
__pyx_t_7 = __pyx_t_2;
__pyx_L76_bool_binop_done:;
__pyx_v_plan_has_content = __pyx_t_7;
+4691: if plan_has_content:
if (__pyx_v_plan_has_content) {
/* … */
}
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
/* … */
if (__pyx_v_plan_has_content) {
/* … */
}
+4692: line_sender_buffer_clear_marker(ls_buf)
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
/* … */
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
/* … */
line_sender_buffer_clear_marker(__pyx_v_ls_buf);
+4693: dataframe_plan_release(&plan)
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
/* … */
__pyx_f_7questdb_7_client_dataframe_plan_release((&__pyx_v_plan));
+4694: qdb_pystr_buf_free(b)
qdb_pystr_buf_free(__pyx_v_b);
/* … */
qdb_pystr_buf_free(__pyx_v_b);
/* … */
qdb_pystr_buf_free(__pyx_v_b);
+4695: owner._leave_row()
__pyx_f_7questdb_7_client_6Buffer__leave_row(__pyx_v_owner);
goto __pyx_L6;
}
__pyx_L5_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0;
__Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
__Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
__Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
__Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
__Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
__Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
__Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
__Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
__Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
__Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_ExceptionSwap(&__pyx_t_37, &__pyx_t_38, &__pyx_t_39);
if ( unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_37);
__Pyx_XGOTREF(__pyx_t_38);
__Pyx_XGOTREF(__pyx_t_39);
__pyx_t_17 = __pyx_lineno; __pyx_t_32 = __pyx_clineno; __pyx_t_33 = __pyx_filename;
{
/* … */
__pyx_f_7questdb_7_client_6Buffer__leave_row(__pyx_v_owner);
}
__Pyx_XGIVEREF(__pyx_t_37);
__Pyx_XGIVEREF(__pyx_t_38);
__Pyx_XGIVEREF(__pyx_t_39);
__Pyx_ExceptionReset(__pyx_t_37, __pyx_t_38, __pyx_t_39);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
__pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_37 = 0; __pyx_t_38 = 0; __pyx_t_39 = 0;
__pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_32; __pyx_filename = __pyx_t_33;
goto __pyx_L1_error;
}
__pyx_L4_return: {
__pyx_t_1 = __pyx_r;
/* … */
__pyx_f_7questdb_7_client_6Buffer__leave_row(__pyx_v_owner);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
}
__pyx_L6:;
}